Tech Off Post

Single Post Permalink

View Thread: TcpClient - Test for Disconnected?
  • User profile image
    cheong

    phreaks said:
    cheong said:
    *snip*
    That's all good, but the issue how can you test connectivity when you only have control of one end?

    Say, I am just opening a socket, and reading whatever gets pushed, indefinitely.

    How can I figure out if something hiccups?

    I could have a timer, that checks a timestamp of the last read, and if it's greater than some interval, assume the connection died and recycle the socket; but it seems kludgy.

    Even if you have control on the other end, if the connection is broken, do you have another way to signal the other end to do what you want?

    Even if you want the other end to send back packet to interval, that's just another form of "timeout"...

    Now consider those busy servers that receive thousands/millions of connection a per minute, can the network stand this additional workload of "bookkeeping"?

    IMHO, "Request on demend" is a more appropiate way of doing this...