コード例 #1
0
        private void AcceptThread(object state)
        {
            while (!this.isClosed)
            {
                try
                {
                    var tcpClient = this.tcpListener.AcceptTcpClient();
                    var client    = new SimpleClient(tcpClient, this.scene);

                    lock (this.clientsLock)
                    {
                        this.clients.Add(client);
                    }
                }
                catch (SocketException ex)
                {
                    logger.Info("Disconnect {0}", ex.Message);

                    break;
                }
            }
        }
コード例 #2
0
ファイル: SimpleServer.cs プロジェクト: wuyuntao/Synchronica
        private void AcceptThread(object state)
        {
            while (!this.isClosed)
            {
                try
                {
                    var tcpClient = this.tcpListener.AcceptTcpClient();
                    var client = new SimpleClient(tcpClient, this.scene);

                    lock (this.clientsLock)
                    {
                        this.clients.Add(client);
                    }
                }
                catch (SocketException ex)
                {
                    logger.Info("Disconnect {0}", ex.Message);

                    break;
                }
            }
        }