private void RemoveClient(ServerClient client) { if (!_clients.Contains(client)) { return; } client.Close(); OnDisconnectClient(client); _clients.Remove(client); }
private void ConnectClient(ServerClient client) { if (AcceptClient(client)) { AddClient(client); } else { OnRefuseClient(client); client.Close(); } }
public void Close() { try { if (!IsClosedOrFaulted) { _client.Close(); } } catch { //do nothing } }