Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Timeout for an established connection

by zentara (Archbishop)
on Dec 31, 2012 at 11:39 UTC ( #1011048=note: print w/ replies, xml ) Need Help??


in reply to Timeout for an established connection

Maybe IO::Select would work, see Does IO::Select work? Anywhere? and Strange piece of code! and How time out can be done here? for some recent discussions.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: Timeout for an established connection
Re^2: Timeout for an established connection
by 0day (Sexton) on Dec 31, 2012 at 12:03 UTC
    Thanks, but... maybe you need to carefully read the question?
      maybe you need to carefully read the question

      I thought I did. :-) IO::Select can be used to set a timeout on reading a socket filehandle. Why aren't you using it? I thought it was in one of the links I listed above.

      FWIW, the method which I found to be workable, comes from the way event-loop systems, like Glib or AnyEvent does it. In those systems, when you you get the meta data from the socket connection that an 'IN' condition has occured, but yet there is no data there to be read, then your connection is caput. See Gtk2 server and client GUI's with root messaging for an example.

      Also see blocking, non-blocking, and semi-blocking, and Knowing when a socket connection is dead for more Select ideas.

      Sorry if I didn't read your question closely enough, but I can't see why select is out of the universe of possible solutions for you. In any event, have a happy new years eve. :-)


      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh
        I believe that the "IO :: Poll," is better than "IO :: Selekt" because no limit on the number of sockets. I do not use "IO :: Seleсt" because I use IO :: Poll. But this does not solve the problem. Happy new year!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2014-09-20 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (157 votes), past polls