public void Dispose() { if (NetworkSocket != null && NetworkSocket.Connected) { NetworkSocket.Shutdown(SocketShutdown.Both); } }
public void Shutdown() { Log.Information("Server socket closing..."); NetworkSocket?.Shutdown("Server going down for quit"); NetworkSocket = null; NetworkPipe = null; NetConfiguration = null; }
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; }
public void Disconnect(Exception ex) { if (NetworkSocket != null) { NetworkSocket.Shutdown(SocketShutdown.Both); NetworkSocket.Dispose(); NetworkSocket = null; OnDisconnect?.Invoke(this, ex); } }