How to tell when a Socket has been disconnected

后端 未结 5 1316
滥情空心
滥情空心 2021-02-05 11:36

On the client side I need to know when/if my socket connection has been broken. However the Socket.Connected property always returns true, even after the server side has been d

5条回答
  •  失恋的感觉
    2021-02-05 11:55

    does the clientSocket.Send() method wait for the packet to either be ack/nack'd?

    If not your code is flying onto the next line while socket is still trying to figure out what is going on.

提交回复
热议问题