Beispiel #1
0
 public void OnSockMgrShutdownBegin(object sender, SockMgrShutdownBeginEventArgs e)
 {
     // TODO: Dispose protocol stack
     _sockMgr.GetProtocolStack()?.Dispose();
     try
     {
         // print: [Shutdown] local -> remote
         if (e.Handler.GetSockBase().Role == SocketRole.Client)
         {
             Console.WriteLine(string.Format("[Shutdown] {0} -> {1}",
                                             e.Handler.GetSockBase().GetSocket().LocalEndPoint.ToString(),
                                             e.Handler.GetSockBase().GetSocket().RemoteEndPoint.ToString()));
         }
         if (e.Handler.GetSockBase().Role == SocketRole.Listener)
         {
             Console.WriteLine(string.Format("[Shutdown] {0} <- *",
                                             e.Handler.GetSockBase().GetSocket().LocalEndPoint.ToString()));
         }
         Console.Write("> ");
     }
     catch (ObjectDisposedException) { }
 }
Beispiel #2
0
 private void OnSockMgrShutdownBegin(object sender, SockMgrShutdownBeginEventArgs e)
 {
     RemoveSockMgr(e.Handler);
     SockMgrShutdownBeginEvent?.Invoke(sender, e);
 }