In the event a user closes the application I have the following:
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
client.Shutdown(SocketShutdown.Both);
}
When this happens my server triggers my Receive Callback routine. But there is no data.
Is there an existing method such as OnDisconnect()
or OnShutdown()
I can call in order for me to update my server and other clients?
Or should I add my own disconnect message prior to the shutdown command on the client?