return factory;
}
- public override ValueTask<ConnectionListener> BindAsync(EndPoint endPoint, IConnectionProperties options = null, CancellationToken cancellationToken = default)
+ public override ValueTask<ConnectionListener> ListenAsync(EndPoint endPoint, IConnectionProperties options = null, CancellationToken cancellationToken = default)
{
if (cancellationToken.IsCancellationRequested) return ValueTask.FromCanceled<ConnectionListener>(cancellationToken);
return new ValueTask<ConnectionListener>(new VirtualConnectionListener(endPoint));
public abstract partial class ConnectionListenerFactory : System.IAsyncDisposable, System.IDisposable
{
protected ConnectionListenerFactory() { }
- public abstract System.Threading.Tasks.ValueTask<System.Net.Connections.ConnectionListener> BindAsync(System.Net.EndPoint? endPoint, System.Net.Connections.IConnectionProperties? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+ public abstract System.Threading.Tasks.ValueTask<System.Net.Connections.ConnectionListener> ListenAsync(System.Net.EndPoint? endPoint, System.Net.Connections.IConnectionProperties? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
/// </summary>
public abstract class ConnectionListenerFactory : IAsyncDisposable, IDisposable
{
- public abstract ValueTask<ConnectionListener> BindAsync(EndPoint? endPoint, IConnectionProperties? options = null, CancellationToken cancellationToken = default);
+ public abstract ValueTask<ConnectionListener> ListenAsync(EndPoint? endPoint, IConnectionProperties? options = null, CancellationToken cancellationToken = default);
public void Dispose()
{
public async Task CustomConnectionFactory_AsyncRequest_Success()
{
await using ConnectionListenerFactory listenerFactory = new VirtualNetworkConnectionListenerFactory();
- await using ConnectionListener listener = await listenerFactory.BindAsync(endPoint: null);
+ await using ConnectionListener listener = await listenerFactory.ListenAsync(endPoint: null);
await using ConnectionFactory connectionFactory = VirtualNetworkConnectionListenerFactory.GetConnectionFactory(listener);
// TODO: if GenericLoopbackOptions actually worked for HTTP/1 LoopbackServer we could just use that and pass in to CreateConnectionAsync.