in reply to Re^4: Absolute simplest way to keep a database variable persistent?
in thread Absolute simplest way to keep a database variable persistent?
Some things to consider to make it dummy proof is allow it to adjust what port is runs on at runtime, and to have the server exit after a while to avoid zombie processes.my $sock = new IO::Socket::INET ( LocalHost => $server, LocalPort => 9200, Proto => 'tcp', Listen => 2, ReuseAddr => 1, ); die "socket creation error: $!" unless $sock; while( my $client = $sock->accept() ) { binmode $client, ":utf8"; $client->autoflush(1); # Read data while( $client->recv( $in_buffer, $buffer_size ) ) { # Store data } # Process data # Return data $client->send( $output ); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Absolute simplest way to keep a database variable persistent?
by natestraight (Novice) on Oct 08, 2008 at 01:52 UTC |