BindAsync -> ListenAsync (#40068)
authorGeoff Kizer <geoffrek@microsoft.com>
Wed, 29 Jul 2020 11:31:25 +0000 (04:31 -0700)
committerGitHub <noreply@github.com>
Wed, 29 Jul 2020 11:31:25 +0000 (04:31 -0700)
BindAsync -> ListenAsync

src/libraries/Common/tests/System/Net/VirtualNetwork/VirtualNetworkConnectionListenerFactory.cs
src/libraries/System.Net.Connections/ref/System.Net.Connections.cs
src/libraries/System.Net.Connections/src/System/Net/Connections/ConnectionListenerFactory.cs
src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs

index 0a47a25..b25a612 100644 (file)
@@ -20,7 +20,7 @@ namespace System.Net.Test.Common
             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));
index c82551e..6eaa384 100644 (file)
@@ -61,7 +61,7 @@ namespace System.Net.Connections
     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; }
index d208f05..7e6339d 100644 (file)
@@ -11,7 +11,7 @@ namespace System.Net.Connections
     /// </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()
         {
index 356dff6..c8d6078 100644 (file)
@@ -114,7 +114,7 @@ namespace System.Net.Http.Functional.Tests
         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.