jj808 has asked for the wisdom of the Perl Monks concerning the following question:
The behaviour I want is for incoming connections to be accepted until each child process is busy, but any connections after that should be rejected (i.e. no queueing).
So do I do this:
or this:my $socket = IO::Socket::INET->new(LocalPort => 12345, Type => SOCK_STREAM, Reuse => 1, Listen => 1 );
I would guess at the second version, thinking that the socket is a single resource shared by the child processes. But what I don't want to happen is for each child to let MAX_SERVERS requests queue up - for this application some requests can take hours to complete, so it is better to just refuse connections when the server is busy.my $socket = IO::Socket::INET->new(LocalPort => 12345, Type => SOCK_STREAM, Reuse => 1, Listen => MAX_SERVERS ); # MAX_SERVERS = total no. of child processes
Thanks in advance,
JJ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Behaviour of 'Listen' parameter in socket for preforking server
by fokat (Deacon) on Sep 26, 2002 at 02:41 UTC | |
by jj808 (Hermit) on Sep 26, 2002 at 03:25 UTC | |
by jj808 (Hermit) on Sep 26, 2002 at 09:12 UTC |