-
Notifications
You must be signed in to change notification settings - Fork 9.8k
/
MultiplexedConnectionContext.cs
31 lines (28 loc) · 1.17 KB
/
MultiplexedConnectionContext.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
namespace Microsoft.AspNetCore.Connections
{
/// <summary>
/// Encapsulates all information about a multiplexed connection.
/// </summary>
public abstract class MultiplexedConnectionContext : BaseConnectionContext, IAsyncDisposable
{
/// <summary>
/// Asynchronously accept an incoming stream on the connection.
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public abstract ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Creates an outbound connection
/// </summary>
/// <param name="features"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public abstract ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default);
}
}