@@ -17,13 +17,13 @@ public ProxyConnector(IServiceFactory serviceFactory, ISocketFactory socketFacto
1717 {
1818 }
1919
20- protected internal IConnector GetConnector ( IConnectionInfo connectionInfo )
20+ protected internal IConnector GetProxyConnector ( IConnectionInfo proxyConnectionInfo )
2121 {
22- if ( connectionInfo == null )
23- throw new ArgumentNullException ( "connectionInfo" ) ;
24- if ( connectionInfo . GetType ( ) != typeof ( IProxyConnectionInfo ) )
25- throw new ArgumentException ( "Expecting connectionInfo to be of type IProxyConnectionInfo" ) ;
26- return ServiceFactory . CreateConnector ( connectionInfo . ProxyConnection , SocketFactory ) ;
22+ if ( proxyConnectionInfo == null )
23+ throw new ArgumentNullException ( "connectionInfo.ProxyConnection " ) ;
24+ if ( proxyConnectionInfo . GetType ( ) != typeof ( IProxyConnectionInfo ) )
25+ throw new ArgumentException ( "Expecting ProxyConnection to be of type IProxyConnectionInfo" ) ;
26+ return ServiceFactory . CreateConnector ( proxyConnectionInfo , SocketFactory ) ;
2727 }
2828
2929 protected abstract void HandleProxyConnect ( IConnectionInfo connectionInfo , Socket socket ) ;
@@ -44,7 +44,7 @@ protected virtual Task HandleProxyConnectAsync(IConnectionInfo connectionInfo, S
4444
4545 public override Socket Connect ( IConnectionInfo connectionInfo )
4646 {
47- ProxyConnection = GetConnector ( connectionInfo ) ;
47+ ProxyConnection = GetProxyConnector ( connectionInfo . ProxyConnection ) ;
4848 var socket = ProxyConnection . Connect ( connectionInfo . ProxyConnection ) ;
4949
5050 try
@@ -64,7 +64,7 @@ public override Socket Connect(IConnectionInfo connectionInfo)
6464#if FEATURE_TAP
6565 public override async Task < Socket > ConnectAsync ( IConnectionInfo connectionInfo , CancellationToken cancellationToken )
6666 {
67- ProxyConnection = GetConnector ( connectionInfo ) ;
67+ ProxyConnection = GetProxyConnector ( connectionInfo . ProxyConnection ) ;
6868 var socket = await ProxyConnection . ConnectAsync ( connectionInfo . ProxyConnection , cancellationToken ) . ConfigureAwait ( false ) ;
6969
7070 try
0 commit comments