internal RemoteConnection(SocketCache socketCache, String machineAndPort) { _socketCache = socketCache; _cachedSocketList = new CachedSocketList(); // parse "machinename:port" String[] parts = machineAndPort.Split(colonSep); String machineName = parts[0]; int port = Convert.ToInt32(parts[1]); _machineAndPort = machineAndPort; IPAddress addr = null; // we'll just let the exception bubble up if the machineName cannot // be resolved. IPHostEntry ipEntries = Dns.Resolve(machineName); if ((ipEntries != null) && (ipEntries.AddressList.Length > 0)) { addr = ipEntries.AddressList[0]; } _ipEndPoint = new IPEndPoint(addr, port); } // RemoteConnection
internal RemoteConnection(SocketCache socketCache, string machineAndPort) { this._socketCache = socketCache; this._cachedSocketList = new CachedSocketList(socketCache.SocketTimeout, socketCache.CachePolicy); this._uri = new Uri("dummy://" + machineAndPort); this._port = this._uri.Port; this._machineAndPort = machineAndPort; }
internal RemoteConnection(SocketCache socketCache, String machineAndPort) { _socketCache = socketCache; _cachedSocketList = new CachedSocketList(socketCache.SocketTimeout, socketCache.CachePolicy); // parse "machinename:port", add a dummy scheme to get uri parsing _uri = new Uri("dummy://" + machineAndPort); _port = _uri.Port; _machineAndPort = machineAndPort; } // RemoteConnection
internal RemoteConnection(SocketCache socketCache, String machineAndPort) { _socketCache = socketCache; _cachedSocketList = new CachedSocketList(socketCache.SocketTimeout, socketCache.CachePolicy); // parse "machinename:port", add a dummy scheme to get uri parsing Uri uri = new Uri("dummy://" + machineAndPort); string machineName = uri.Host; _port = uri.Port; _machineAndPort = machineAndPort; _addressList = Dns.GetHostAddresses(machineName); connectIPv6 = Socket.OSSupportsIPv6 && HasIPv6Address(_addressList); } // RemoteConnection
internal RemoteConnection(SocketCache socketCache, String machineAndPort) { _socketCache = socketCache; _cachedSocketList = new CachedSocketList(); // parse "machinename:port" String[] parts = machineAndPort.Split(colonSep); String machineName = parts[0]; int port = Convert.ToInt32(parts[1]); _machineAndPort = machineAndPort; IPAddress addr = null; // we'll just let the exception bubble up if the machineName cannot // be resolved. IPHostEntry ipEntries = Dns.Resolve(machineName); addr = CoreChannel.GetMachineAddress(ipEntries, AddressFamily.InterNetwork); _ipEndPoint = new IPEndPoint(addr, port); } // RemoteConnection