In c-sharp, how can the socket on the server detect whether the client is not connected?

when the client is physically disconnected, such as artificially disconnecting the network, how can the socket of the server detect that the client can no longer connect to the server?

Jun.22,2021

Let the client send heartbeats regularly?

if the network is peer-to-peer, you can send a packet to see if there is any pingback or other

.
Menu