Beispiel #1
0
 private void SocketConnectHandler()
 {
     while (IsRunning)
     {
         var clientTask = Listener.AcceptTcpClientAsync();
         if (clientTask.Result != null)
         {
             var socketClient = new ConnectedClientTcpHandler(clientTask.Result);
             Log.Info($"Client {socketClient.ConnectionId} connected.");
             _clientsByConnectionId.Add(socketClient.ConnectionId, socketClient);
             ThreadPool.QueueUserWorkItem(ConnectedClientTcpHandler.RecievePacketWorker, socketClient);
         }
     }
 }