Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

how to tell when socket breaks?

by redss (Monk)
on Oct 22, 2007 at 16:17 UTC ( [id://646481]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://646481]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-25 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found