Example #1
0
 public void Dispose()
 {
     if (NetworkSocket != null && NetworkSocket.Connected)
     {
         NetworkSocket.Shutdown(SocketShutdown.Both);
     }
 }
Example #2
0
        public void Shutdown()
        {
            Log.Information("Server socket closing...");
            NetworkSocket?.Shutdown("Server going down for quit");

            NetworkSocket    = null;
            NetworkPipe      = null;
            NetConfiguration = null;
        }
Example #3
0
 public void Dispose()
 {
     if (NetworkSocket.Connected)
     {
         NetworkSocket.Shutdown(SocketShutdown.Both);
         NetworkSocket.Disconnect(true);
     }
     NetworkSocket.Close(1000);
 }
        /// <summary>
        /// Shutdown the network client
        /// </summary>
        public void Shutdown()
        {
            Log.Information("stopping Client NetworkSocket...");
            NetworkSocket?.Shutdown("Client application exited");

            NetworkSocket    = null;
            NetConfiguration = null;
            MessagePipe      = null;
        }
Example #5
0
 public void Disconnect(Exception ex)
 {
     if (NetworkSocket != null)
     {
         NetworkSocket.Shutdown(SocketShutdown.Both);
         NetworkSocket.Dispose();
         NetworkSocket = null;
         OnDisconnect?.Invoke(this, ex);
     }
 }