public static void SafeStartConnection(this IServerConnectionInspector connectionInspector) { if (connectionInspector != null) { connectionInspector.StartConnection(); } }
public static void SafeFinishDnsResolve(this IServerConnectionInspector connectionInspector) { if (connectionInspector != null) { connectionInspector.FinishDnsResolve(); } }
public static void SafeConnectionMade(this IServerConnectionInspector connectionInspector) { if (connectionInspector != null) { connectionInspector.ConnectionMade(); } }
public HostConnector(string host, bool secure, Action<Socket> connectionMadeCallback, Action errorCallback, ProxySettings settings) { this.connectionMadeCallback = connectionMadeCallback; this.errorCallback = errorCallback; Uri uri = new Uri((secure ? "https://" : "http://") + host); this.host = uri.Host; this.port = uri.Port; this.hostIsIP = uri.HostNameType == UriHostNameType.IPv4 || uri.HostNameType == UriHostNameType.IPv6; if (settings != null && settings.InspectorFactory != null) { this.connectionInspector = settings.InspectorFactory.CreateServerConnectionInspector(this.host, this.port, secure); } }
public HostConnector(string host, bool secure, Action <Socket> connectionMadeCallback, Action errorCallback, ProxySettings settings) { this.connectionMadeCallback = connectionMadeCallback; this.errorCallback = errorCallback; Uri uri = new Uri((secure ? "https://" : "http://") + host); this.host = uri.Host; this.port = uri.Port; this.hostIsIP = uri.HostNameType == UriHostNameType.IPv4 || uri.HostNameType == UriHostNameType.IPv6; if (settings != null && settings.InspectorFactory != null) { this.connectionInspector = settings.InspectorFactory.CreateServerConnectionInspector(this.host, this.port, secure); } }