Problems with UDP
How can I know if the client has closed down the socket/program if I am using unconnected UDP?
(In TCP, recv() returns 0 when this happends, but recvfrom() returning 0 is not the same thing.)
UDP is not a connection based protocol. There is no connection: if you want to detect when a host is down you have to implement the thing by yourself.
A possible solution is to send "keep-alive" packets every x seconds and set a timeout on the receiver machine. If you don''t receive keep-alives for a period of time you can assume that the other machine has "disconnected".
A possible solution is to send "keep-alive" packets every x seconds and set a timeout on the receiver machine. If you don''t receive keep-alives for a period of time you can assume that the other machine has "disconnected".
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement