Ejemplo n.º 1
0
 //    TcpClient tcp_client = null;
 private void tcpSrv()
 {
     try
     {
         while (!IsDisposing)
         {
             try
             {
                 {
                     TcpClient ClientHandle = tcp_socket.AcceptTcpClient();
                     var       clt          = new SingleBotTcpClient(ClientHandle, this);
                     singleBotTcpClients.Add(clt);
                     Thread t = new Thread(new ThreadStart(clt.DoLoop));
                     t.Name = "ClientHandle thread for " + ClientHandle + " " + ToString();
                     t.Start();
                 }
             }
             catch (Exception e)
             {
                 WriteLine(e.ToString());
             }
         }
         //  tcp_socket.Stop();
         // thrSvr.Abort();
     }
     catch (Exception ee)
     {
         WriteLine(ee.ToString());
     }
 }
Ejemplo n.º 2
0
        //    TcpClient tcp_client = null;
        private void tcpSrv()
        {

            try
            {
                while (!IsDisposing)
                {
                    try
                    {

                        {
                            TcpClient ClientHandle = tcp_socket.AcceptTcpClient();
                            var clt = new SingleBotTcpClient(ClientHandle, this);
                            singleBotTcpClients.Add(clt);
                            Thread t = new Thread(new ThreadStart(clt.DoLoop));
                            t.Name = "ClientHandle thread for " + ClientHandle + " " + ToString();
                            t.Start();

                        }
                    }
                    catch (Exception e)
                    {
                        WriteLine(e.ToString());
                    }
                }
                //  tcp_socket.Stop();
                // thrSvr.Abort();

            }
            catch (Exception ee)
            {
                WriteLine(ee.ToString());
            }
        }