Пример #1
0
        private void _worker()
        {
            this._listner = new TcpListener(IPAddress.Any, this.Port);
            this._listner.Start();
            this.Started = true;

            while (this.Started)
            {
                TcpClient client = this._listner.AcceptTcpClient();

                Connection connection = new Connection(client, this.Handlers, this._auth, this._aftercon);
                connection.Context = this._contextFactory.MakeContext(connection);
            this._connectios.Add(connection);
            int SesionId = 	this._connectios.IndexOf(connection);
                connection.RunServerProtocolClient(SesionId);
            }
        }