public IConnectionContext OnConnection(IConnectionInformation connectionInfo)
        {
            var inputOptions = new PipeOptions {
                WriterScheduler = connectionInfo.InputWriterScheduler
            };
            var outputOptions = new PipeOptions {
                ReaderScheduler = connectionInfo.OutputReaderScheduler
            };

            var context = new HttpConnectionContext
            {
                ConnectionId = Guid.NewGuid().ToString(),
                Input        = connectionInfo.PipeFactory.Create(inputOptions),
                Output       = connectionInfo.PipeFactory.Create(outputOptions),
            };

            _ = context.ExecuteAsync();

            return(context);
        }
Exemplo n.º 2
0
        IConnectionContext IConnectionHandler.OnConnection(IConnectionInformation connectionInfo)
        {
            var inputOptions = new PipeOptions {
                WriterScheduler = InlineScheduler.Default
            };
            var outputOptions = new PipeOptions {
                ReaderScheduler = InlineScheduler.Default
            };

            var context = new HttpConnectionContext <THandler>
            {
                ConnectionId = Guid.NewGuid().ToString(),
                Input        = connectionInfo.PipeFactory.Create(inputOptions),
                Output       = connectionInfo.PipeFactory.Create(outputOptions)
            };

            _ = context.ExecuteAsync();

            return(context);
        }