Пример #1
0
        public threadedServer()
        {
            client = new TcpListener(IPAddress.Any, 7777);
            client.Start();
            Console.WriteLine("PSUnity Server by Micky Balladelli");

            Console.WriteLine("Waiting for clients...");

            while (true)
            {
                while (!client.Pending())
                {
                    Thread.Sleep(1000);
                }
                ConnectionThread newconnection = new ConnectionThread();
                newconnection.threadListner = this.client;
                Thread newthread = new Thread(new ThreadStart(newconnection.HandleConnection));
                newthread.Start();
            }
        }
Пример #2
0
        public threadedServer()
        {
            client = new TcpListener(IPAddress.Any, 7777);
            client.Start();
            Console.WriteLine("PSUnity Server by Micky Balladelli");

            Console.WriteLine("Waiting for clients...");

            while (true)
            {
                while (!client.Pending())
                {
                    Thread.Sleep(1000);
                }
                ConnectionThread newconnection = new ConnectionThread();
                newconnection.threadListner = this.client;
                Thread newthread = new Thread(new ThreadStart(newconnection.HandleConnection));
                newthread.Start();
            }
        }