public void Disconnect() { if (!Mode) { if (ClientsPool.ContainsKey(EnemyPoint.ToString())) { SendMessage(ClientsPool[EnemyPoint.ToString()].GetStream(), MessageCode.Fin); ClientsPool[EnemyPoint.ToString()].Close(); } } }
private void ClearWatingList() { //clears all waiting users except the choosen one Dictionary <string, TcpClient> .KeyCollection Keys = ClientsPool.Keys; foreach (string key in Keys) { if (key != EnemyPoint.ToString()) { ClientsPool.Remove(key); } } }