private void TryShutdown(IAsyncResult ar)
        {
            try
            {
                Socket.EndDisconnect(ar);
                ShutdownCompleted?.Invoke(this, new TcpCompletedEventArgs());
            }
            catch (Exception ex)
            {
                var eventArgs = new TcpCompletedEventArgs(ex);
                eventArgs.Error = true;

                ShutdownCompleted?.Invoke(this, eventArgs);
            }
        }
Exemplo n.º 2
0
 private void Socket_ShutdownCompleted(object sender, TcpCompletedEventArgs e)
 {
     ShutdownCompleted?.Invoke(sender, e);
 }
Exemplo n.º 3
0
 public void Shutdown()
 {
     IsShuttingDown = true;
     OnShutdown();
     ShutdownCompleted?.Invoke(this, EventArgs.Empty);
 }