Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: IO::Socket::INET Dangling Connections

by rpc (Monk)
on Feb 21, 2001 at 00:24 UTC ( [id://59761]=note: print w/replies, xml ) Need Help??


in reply to IO::Socket::INET Dangling Connections

IO::Select is what you need. This will allow you to perform a non-blocking wait on the socket.
use IO::Select; use constant TIMEOUT => 10; ... ... my $select = IO::Select->new(); $select->add($con); # from your example above. # Don't need to save the array returned, there's only one handle. if($select->can_read(TIMEOUT)) { # $con has pending data. } else { # timeout. }

Replies are listed 'Best First'.
Re: Re: IO::Socket::INET Dangling Connections
by Anonymous Monk on Feb 21, 2001 at 02:07 UTC
    Thank you very much for that reply. I'm now looking into the docs on IO::Select... it's an interesting module. I'm going to look into it and see if I can figure it out from here. My data processing routines will have to be modified, but I htink I can handle it from here. Thanks so much.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-24 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found