public void Disconnect() { if (InternalSocket.Connected) { InternalSocket.Disconnect(false); } }
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; } }