Esempio n. 1
0
 private void _HandleConnectionClosedByRemote(_TcpClosePacket packet = null)
 {
     ULogger.Info(packet != null ?
                  $"<{serviceName}> Connection closed by remote." :
                  $"<{serviceName}> Connection to remote is lost.");
     _client.Dispose();
     _client = null;
     Shutdown();
     if (retryInterval > 0)
     {
         Startup();
     }
 }
Esempio n. 2
0
 private void _CloseConnectionToClient(_TcpClosePacket packet = null)
 {
     if (packet != null)
     {
         ULogger.Info($"<{serviceName}> Close connection to client.");
         Send(new _TcpClosePacket());
     }
     else
     {
         ULogger.Info($"<{serviceName}> Connection to client is closed.");
     }
     _client.Dispose();
     _client = null;
     _listener.Start();
     Disconnected.Trigger();
 }