private async void ListenLoop() { while (true) { TcpClient client = await _tcpListener.AcceptTcpClientAsync(); if (client == null) break; var webSocketclient = new WebSocketClient(client); clients.Add(client); Task.Factory.StartNew(webSocketclient.Listen); } }