Esempio n. 1
0
 public void Disconnect()
 {
     if (InternalSocket.Connected)
     {
         InternalSocket.Disconnect(false);
     }
 }
Esempio n. 2
0
        public void Dispose()
        {
            if (!IsDisposed)
            {
                ServerEndPoint = null;
                InternalSocket.Disconnect(false);
                InternalSocket.Shutdown(SocketShutdown.Both);
                InternalSocket.Dispose();

                foreach (var client in ConnectedClients)
                {
                    RemoveClient(client.Value);
                }

                AllowedAccounts.RemoveRange(0, AllowedAccounts.Count);

                AllowedAccounts  = null;
                ConnectedClients = null;
                IsDisposed       = true;
            }
        }