Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: IO::Select and correct way to detect client crashed?

by sundialsvc4 (Abbot)
on Oct 18, 2012 at 19:50 UTC ( [id://999808]=note: print w/replies, xml ) Need Help??


in reply to IO::Select and correct way to detect client crashed?

The only practical way that I have ever found to determine whether a client has crashed is to oblige the protocol between the two to periodically send a “heartbeat” message if there is nothing else to be sent during some mutually agreed-upon interval.   The host should record the latest timestamp as each socket sends a message, or just a boolean flag, and use a periodic timer, say about half-again as long as the heartbeat, to check for absence of response within that time.   Upon which the host might presume that the client is dead.   You see, you really can’t be 100% sure, AFAIK, that all of the intermediates between here-and-there are still in good working order.   Maybe the host knows that the socket has been closed or that communication has failed, or maybe it doesn’t.   But if a bottle washes up on shore, even if it’s empty, you know the sender is still out there.

Replies are listed 'Best First'.
Re^2: IO::Select and correct way to detect client crashed?
by BrowserUk (Patriarch) on Oct 18, 2012 at 20:13 UTC

    More of your patented, utter ribald tosh...

    (Don't be encouraged by the upvote; that was me by accident.)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

      Ribald?!?
      --
      A math joke: r = | |csc(θ)|+|sec(θ)|-||csc(θ)|-|sec(θ)|| |

        As in the "sexing up" of the September dossier.

        Take a basic, vaguely related, even more vaguely true, notion, and sex it up until it reads to the uninformed, like it says something important.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        RIP Neil Armstrong

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-19 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found