private void ClientManagerOnDisconnected(object sender, ClientEventArgs clientEventArgs) { string stripport = clientEventArgs.IP.ToString() + "#" + clientEventArgs.Port.ToString(); ClientManager clientManager = null; if (dicClientMgr.ContainsKey(clientEventArgs.IP.ToString())) { dicClientMgr.TryRemove(clientEventArgs.IP.ToString(), out clientManager); ConnectEvent?.Invoke(false); if (ClientDisConnected != null) { ClientDisConnected(clientManager); } clientManager.Disconnect(); } }