Exemple #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();
            }
        }
Exemple #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();
            }
        }