Example #1
0
 protected override void OnClosing(CancelEventArgs e)
 {
     try
     {
         clientManager.Disconnect();
         base.OnClosing(e);
         Environment.Exit(0);
     }
     catch (Exception)
     {
     }
 }
Example #2
0
        private void ClientDisconnect()
        {
            if (client != null && client.IsConnected)
            {
                client.Disconnect();
            }

            InvokeForm(() =>
            {
                ClientConnected = false;
            });
        }