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

            ConnectionReceived(connection);
        }
Beispiel #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();
        }