Пример #1
0
        public void ListenForClients()
        {
            this.serverSocket.Start();
            while (true)
            {
                try
                {
                    TcpClient  clientSocket = this.serverSocket.AcceptTcpClient();
                    ClientArgs args         = new ClientArgs();

                    args.ID = clientSocket;

                    this.clientSocket.Add(clientSocket);
                    OnNewClientRequest(this, args);

                    Thread clientThread = new Thread(new ParameterizedThreadStart(ListenForMessage));
                    clientThread.Start(clientSocket);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.StackTrace);
                    break;
                }
            }
        }
Пример #2
0
        public void ListenForClients()
        {
            this.serverSocket.Start();
            while (true)
            {
                try
                {
                    TcpClient clientSocket = this.serverSocket.AcceptTcpClient();
                    ClientArgs args = new ClientArgs();

                    args.ID = clientSocket;

                    this.clientSocket.Add(clientSocket);
                    OnNewClientRequest(this, args);

                    Thread clientThread = new Thread(new ParameterizedThreadStart(ListenForMessage));
                    clientThread.Start(clientSocket);
                }
                catch(Exception e)
                {
                    Console.WriteLine(e.StackTrace);
                    break;
                }
            }
        }
Пример #3
0
 private void newClientRequest(object a, ClientArgs e)
 {
 }
Пример #4
0
 private void newClientRequest(object a, ClientArgs e)
 {
     logs.addLogFromOutside(Constants.NEW_CLIENT_LOG + " NetworkNode", true, Constants.LOG_INFO);
 }