Exemple #1
0
 public void OnSockMgrShutdownBegin(object sender, SockMgrShutdownBeginEventArgs e)
 {
     _sockController.RemoveSockMgr(e.Handler);
     // 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) { }
 }
Exemple #2
0
 private void OnSockMgrShutdownBegin(object sender, SockMgrShutdownBeginEventArgs e)
 {
     SockMgrShutdownBeginEvent?.Invoke(sender, e);
 }