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