@@ -17,13 +17,13 @@ public ProxyConnector(IServiceFactory serviceFactory, ISocketFactory socketFacto
17
17
{
18
18
}
19
19
20
- protected internal IConnector GetConnector ( IConnectionInfo connectionInfo )
20
+ protected internal IConnector GetProxyConnector ( IConnectionInfo proxyConnectionInfo )
21
21
{
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 is IProxyConnectionInfo ) )
25
+ throw new ArgumentException ( "Expecting ProxyConnection to be of type IProxyConnectionInfo" ) ;
26
+ return ServiceFactory . CreateConnector ( proxyConnectionInfo , SocketFactory ) ;
27
27
}
28
28
29
29
protected abstract void HandleProxyConnect ( IConnectionInfo connectionInfo , Socket socket ) ;
@@ -44,7 +44,7 @@ protected virtual Task HandleProxyConnectAsync(IConnectionInfo connectionInfo, S
44
44
45
45
public override Socket Connect ( IConnectionInfo connectionInfo )
46
46
{
47
- ProxyConnection = GetConnector ( connectionInfo ) ;
47
+ ProxyConnection = GetProxyConnector ( connectionInfo . ProxyConnection ) ;
48
48
var socket = ProxyConnection . Connect ( connectionInfo . ProxyConnection ) ;
49
49
50
50
try
@@ -64,7 +64,7 @@ public override Socket Connect(IConnectionInfo connectionInfo)
64
64
#if FEATURE_TAP
65
65
public override async Task < Socket > ConnectAsync ( IConnectionInfo connectionInfo , CancellationToken cancellationToken )
66
66
{
67
- ProxyConnection = GetConnector ( connectionInfo ) ;
67
+ ProxyConnection = GetProxyConnector ( connectionInfo . ProxyConnection ) ;
68
68
var socket = await ProxyConnection . ConnectAsync ( connectionInfo . ProxyConnection , cancellationToken ) . ConfigureAwait ( false ) ;
69
69
70
70
try
0 commit comments