diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-10-19 23:32:23 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-10-19 23:32:23 -0400 |
| commit | ab61dcaf9075e0433e39181cfd4948f8c17b4959 (patch) | |
| tree | d231d0e15506d193b2e157ddd5faded843676f04 /Mono.Nat/Upnp/UpnpNatDevice.cs | |
| parent | ab61eb5cae54578b434566d0c9d84f38b1b523bf (diff) | |
removed dead code
Diffstat (limited to 'Mono.Nat/Upnp/UpnpNatDevice.cs')
| -rw-r--r-- | Mono.Nat/Upnp/UpnpNatDevice.cs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Mono.Nat/Upnp/UpnpNatDevice.cs b/Mono.Nat/Upnp/UpnpNatDevice.cs index ebb1426d1..2c0fd1105 100644 --- a/Mono.Nat/Upnp/UpnpNatDevice.cs +++ b/Mono.Nat/Upnp/UpnpNatDevice.cs @@ -90,55 +90,6 @@ namespace Mono.Nat.Upnp } } - internal UpnpNatDevice(IPAddress localAddress, string deviceDetails, string serviceType, ILogger logger, IHttpClient httpClient) - { - _logger = logger; - _httpClient = httpClient; - this.LastSeen = DateTime.Now; - this.localAddress = localAddress; - - // Split the string at the "location" section so i can extract the ipaddress and service description url - string locationDetails = deviceDetails.Substring(deviceDetails.IndexOf("Location", StringComparison.OrdinalIgnoreCase) + 9).Split('\r')[0]; - this.serviceType = serviceType; - - // Make sure we have no excess whitespace - locationDetails = locationDetails.Trim(); - - // FIXME: Is this reliable enough. What if we get a hostname as opposed to a proper http address - // Are we going to get addresses with the "http://" attached? - if (locationDetails.StartsWith("http://", StringComparison.OrdinalIgnoreCase)) - { - NatUtility.Log("Found device at: {0}", locationDetails); - // This bit strings out the "http://" from the string - locationDetails = locationDetails.Substring(7); - - // We then split off the end of the string to get something like: 192.168.0.3:241 in our string - string hostAddressAndPort = locationDetails.Remove(locationDetails.IndexOf('/')); - - // From this we parse out the IP address and Port - if (hostAddressAndPort.IndexOf(':') > 0) - { - this.hostEndPoint = new IPEndPoint(IPAddress.Parse(hostAddressAndPort.Remove(hostAddressAndPort.IndexOf(':'))), - Convert.ToUInt16(hostAddressAndPort.Substring(hostAddressAndPort.IndexOf(':') + 1), System.Globalization.CultureInfo.InvariantCulture)); - } - else - { - // there is no port specified, use default port (80) - this.hostEndPoint = new IPEndPoint(IPAddress.Parse(hostAddressAndPort), 80); - } - - NatUtility.Log("Parsed device as: {0}", this.hostEndPoint.ToString()); - - // The service description URL is the remainder of the "locationDetails" string. The bit that was originally after the ip - // and port information - this.serviceDescriptionUrl = locationDetails.Substring(locationDetails.IndexOf('/')); - } - else - { - logger.Warn("Couldn't decode address: " + deviceDetails); - } - } - /// <summary> /// The EndPoint that the device is at /// </summary> |
