예제 #1
0
        public void ListenForClients()
        {
            // Create a model to listen from clients
            _TCPModel = new TCPModel(Int32.Parse("3000"));

//            while (true)
            //   {
            //blocks until a client has connected to the server
            Socket TCPsocket = _TCPModel.AcceptOneClient();

            //create a thread to handle communication with connected client
            clientThread = new Thread(new ParameterizedThreadStart(Communications));
            clientThread.IsBackground = true;     // to stop all threads when application is terminated
            clientThread.Start(TCPsocket);
            // }
        }
예제 #2
0
        public void ListenForClients()
        {
            // Create a model to listen from clients
            _TCPModel = new TCPModel(Int32.Parse("3000"));

            //            while (true)
             //   {
                //blocks until a client has connected to the server
                Socket TCPsocket = _TCPModel.AcceptOneClient();

                //create a thread to handle communication with connected client
                clientThread = new Thread(new ParameterizedThreadStart(Communications));
                clientThread.IsBackground = true; // to stop all threads when application is terminated
                clientThread.Start(TCPsocket);
               // }
        }