Beispiel #1
0
        public Server()
        {
            IPAddress localhost = IPAddress.Parse("127.0.0.1");
            TcpListener listener = new TcpListener(localhost, 1000);
            clients = new List<ServerClientThread>();
            listener.Start();

            TcpClient client = listener.AcceptTcpClient();
            ServerClientThread cl = new ServerClientThread(client, this);
            clients.Add(cl);

            //Run client on new thread
            Thread thread = new Thread(new ThreadStart(cl.run));
            thread.IsBackground = true;
            thread.Start();
        }
Beispiel #2
0
        public Server()
        {
            IPAddress   localhost = IPAddress.Parse("127.0.0.1");
            TcpListener listener  = new TcpListener(localhost, 1000);

            clients = new List <ServerClientThread>();
            listener.Start();


            TcpClient          client = listener.AcceptTcpClient();
            ServerClientThread cl     = new ServerClientThread(client, this);

            clients.Add(cl);

            //Run client on new thread
            Thread thread = new Thread(new ThreadStart(cl.run));

            thread.IsBackground = true;
            thread.Start();
        }