Esempio n. 1
0
        public void ThreadProc()
        {
            while (true)
            {
                /*
                using (Socket clientSocket = socket.Accept())
                {
                    IPEndPoint clientIP = clientSocket.RemoteEndPoint as IPEndPoint;
                    EndPoint clientEndPoint = clientSocket.RemoteEndPoint;
                    clientSocket.ReceiveTimeout = 3000;
                    led.Write(true);
                    Thread.Sleep(150);
                    led.Write(false);

                    HandleClients hc = new HandleClients(clientSocket, led, clientIP, clientEndPoint);
                    this.ClientHandlerThread = new Thread(new ThreadStart(hc.ThreadProc));
                    this.ClientHandlerThread.Start();
                }
                */

                Socket clientSocket = socket.Accept();
                HandleClients hc = new HandleClients(clientSocket, led);
                this.ClientHandlerThread = new Thread(new ThreadStart(hc.ThreadProc));
                this.ClientHandlerThread.Start();
            }
        }
Esempio n. 2
0
        public void ThreadProc()
        {
            while (true)
            {
                /*
                 * using (Socket clientSocket = socket.Accept())
                 * {
                 *  IPEndPoint clientIP = clientSocket.RemoteEndPoint as IPEndPoint;
                 *  EndPoint clientEndPoint = clientSocket.RemoteEndPoint;
                 *  clientSocket.ReceiveTimeout = 3000;
                 *  led.Write(true);
                 *  Thread.Sleep(150);
                 *  led.Write(false);
                 *
                 *  HandleClients hc = new HandleClients(clientSocket, led, clientIP, clientEndPoint);
                 *  this.ClientHandlerThread = new Thread(new ThreadStart(hc.ThreadProc));
                 *  this.ClientHandlerThread.Start();
                 * }
                 */

                Socket        clientSocket = socket.Accept();
                HandleClients hc           = new HandleClients(clientSocket, led);
                this.ClientHandlerThread = new Thread(new ThreadStart(hc.ThreadProc));
                this.ClientHandlerThread.Start();
            }
        }