public void Accept(MudSocket socket) { var tokenStream = new TokenStream(socket); var connection = new TelnetConnection(tokenStream, TelnetHandlerSet.Default(tokenStream)); ConnectionReceived(connection); }
private void Listen(int backlogSize, CancellationToken token) { _server.Listen(backlogSize); while (!token.IsCancellationRequested) { var socket = new MudSocket(_server.Accept()); Accept(socket); } token.ThrowIfCancellationRequested(); }