示例#1
0
        public void Accept(MudSocket socket)
        {
            var tokenStream = new TokenStream(socket);
            var connection  = new TelnetConnection(tokenStream, TelnetHandlerSet.Default(tokenStream));

            ConnectionReceived(connection);
        }
示例#2
0
        private void Listen(int backlogSize, CancellationToken token)
        {
            _server.Listen(backlogSize);

            while (!token.IsCancellationRequested)
            {
                var socket = new MudSocket(_server.Accept());
                Accept(socket);
            }

            token.ThrowIfCancellationRequested();
        }