Beispiel #1
0
        public static async Task <Http2LoopbackConnection> CreateAsync(Socket socket, Stream stream)
        {
            var connection = new Http2LoopbackConnection(socket, stream);
            await connection.ReadPrefixAsync().ConfigureAwait(false);

            return(connection);
        }
        public async Task <Http2LoopbackConnection> AcceptConnectionAsync()
        {
            Socket connectionSocket = await _listenSocket.AcceptAsync().ConfigureAwait(false);

            var stream = new NetworkStream(connectionSocket, ownsSocket: true);

            return(await Http2LoopbackConnection.CreateAsync(connectionSocket, stream).ConfigureAwait(false));
        }