Exemplo n.º 1
0
 /// <summary>
 /// Abort the current operation.
 /// </summary>
 public void Abort()
 {
     if (_secureConnection)
     {
         _sslSocket.Close(false);
     }
     else
     {
         _socket.Close(false);
     }
 }
Exemplo n.º 2
0
        public void Disconnected()
        {
            if (LV != null)
            {
                if (Program.form1.listView1.InvokeRequired)
                {
                    Program.form1.listView1.BeginInvoke((MethodInvoker)(() =>
                    {
                        try
                        {
                            lock (Settings.Listview1Lock)
                                LV.Remove();

                            if (LV2 != null)
                            {
                                lock (Settings.Listview3Lock)
                                    LV2.Remove();
                            }
                        }
                        catch { }
                    }));
                }

                lock (Settings.Online)
                    Settings.Online.Remove(this);
            }

            try
            {
                TcpClient.Shutdown(SocketShutdown.Both);
            }
            catch { }

            try
            {
                SslClient?.Close();
                TcpClient?.Close();
                SslClient?.Dispose();
                TcpClient?.Dispose();
                ClientMS?.Dispose();
            }
            catch { }
        }
Exemplo n.º 3
0
 public void Cleanup()
 {
     server.StopAndAssertStopped();
     lClient.Close();
     sClient.Close();
 }