redss has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

My perl script accepts a socket connection then waits for a 2nd socket connection

while ( my $cgiclient = $cgisock->accept() ) {....

I need my script to stop waiting for a 2nd socket connection if the first socket connection breaks. How do I monitor both in the above wait condition?

Replies are listed 'Best First'.
Re: how to tell when socket breaks?
by ikegami (Patriarch) on Oct 22, 2007 at 16:42 UTC
    IO::Select can be used to monitor multiple sockets at once.