private void FrmClient_FormClosing(object sender, FormClosingEventArgs e) { client.SendData(ConvertStringToBytes("CLOSING"), "0"); client.Disconnect(); }
//FUNCTION: //Purpose: To send the closing message to the server, often called by the form closing public void Disconnect() { IsConnected = false; client.SendData(ASCIIEncoding.ASCII.GetBytes("CLOSING::"), "0"); client.Disconnect(); }