Skip to content

Commit 8b5467e

Browse files
authored
BindAsync -> ListenAsync (#40068)
BindAsync -> ListenAsync
1 parent 9df596f commit 8b5467e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/libraries/Common/tests/System/Net/VirtualNetwork/VirtualNetworkConnectionListenerFactory.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static ConnectionFactory GetConnectionFactory(ConnectionListener listener
2020
return factory;
2121
}
2222

23-
public override ValueTask<ConnectionListener> BindAsync(EndPoint endPoint, IConnectionProperties options = null, CancellationToken cancellationToken = default)
23+
public override ValueTask<ConnectionListener> ListenAsync(EndPoint endPoint, IConnectionProperties options = null, CancellationToken cancellationToken = default)
2424
{
2525
if (cancellationToken.IsCancellationRequested) return ValueTask.FromCanceled<ConnectionListener>(cancellationToken);
2626
return new ValueTask<ConnectionListener>(new VirtualConnectionListener(endPoint));

src/libraries/System.Net.Connections/ref/System.Net.Connections.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected virtual void Dispose(bool disposing) { }
6161
public abstract partial class ConnectionListenerFactory : System.IAsyncDisposable, System.IDisposable
6262
{
6363
protected ConnectionListenerFactory() { }
64-
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));
64+
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));
6565
public void Dispose() { }
6666
protected virtual void Dispose(bool disposing) { }
6767
public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }

src/libraries/System.Net.Connections/src/System/Net/Connections/ConnectionListenerFactory.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace System.Net.Connections
1111
/// </summary>
1212
public abstract class ConnectionListenerFactory : IAsyncDisposable, IDisposable
1313
{
14-
public abstract ValueTask<ConnectionListener> BindAsync(EndPoint? endPoint, IConnectionProperties? options = null, CancellationToken cancellationToken = default);
14+
public abstract ValueTask<ConnectionListener> ListenAsync(EndPoint? endPoint, IConnectionProperties? options = null, CancellationToken cancellationToken = default);
1515

1616
public void Dispose()
1717
{

src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public SocketsHttpHandler_ConnectionFactoryTest(ITestOutputHelper output) : base
114114
public async Task CustomConnectionFactory_AsyncRequest_Success()
115115
{
116116
await using ConnectionListenerFactory listenerFactory = new VirtualNetworkConnectionListenerFactory();
117-
await using ConnectionListener listener = await listenerFactory.BindAsync(endPoint: null);
117+
await using ConnectionListener listener = await listenerFactory.ListenAsync(endPoint: null);
118118
await using ConnectionFactory connectionFactory = VirtualNetworkConnectionListenerFactory.GetConnectionFactory(listener);
119119

120120
// TODO: if GenericLoopbackOptions actually worked for HTTP/1 LoopbackServer we could just use that and pass in to CreateConnectionAsync.

0 commit comments

Comments
 (0)