Example #1
0
 private void StopServer(InternalServer server)
 {
     server.Connected    -= OnConnected;
     server.Message      -= OnMessage;
     server.Disconnected -= OnDisconnected;
     server.Dispose();
 }
Example #2
0
        public void Dispose()
        {
            if (!IsDisposed)
            {
                IsDisposed = true;

                if (InternalServer != null && InternalServer.Connected)
                {
                    InternalServer.Disconnect(false);
                }

                InternalServer?.Dispose();

                InternalServer = null;
            }
        }