X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Net%2FEndPointManager.cs;h=2f1658ab113ee155ffbb146e8c69ca85652d8abd;hb=280f222afa4eacc502317e41658a125887b207b8;hp=eb4c79852c7269eba8ba196f6ba32c3eed43acb1;hpb=4d84028bd8d48b06a1858854715145e44378e6bd;p=mono.git diff --git a/mcs/class/System/System.Net/EndPointManager.cs b/mcs/class/System/System.Net/EndPointManager.cs index eb4c79852c7..2f1658ab113 100644 --- a/mcs/class/System/System.Net/EndPointManager.cs +++ b/mcs/class/System/System.Net/EndPointManager.cs @@ -26,8 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if SECURITY_DEP - using System.Collections; using System.Collections.Generic; namespace System.Net { @@ -82,9 +80,19 @@ namespace System.Net { static EndPointListener GetEPListener (string host, int port, HttpListener listener, bool secure) { IPAddress addr; - if (IPAddress.TryParse(host, out addr) == false) + if (host == "*") addr = IPAddress.Any; - + else if (IPAddress.TryParse(host, out addr) == false){ + try { + IPHostEntry iphost = Dns.GetHostByName(host); + if (iphost != null) + addr = iphost.AddressList[0]; + else + addr = IPAddress.Any; + } catch { + addr = IPAddress.Any; + } + } Hashtable p = null; // Dictionary if (ip_to_endpoints.ContainsKey (addr)) { p = (Hashtable) ip_to_endpoints [addr]; @@ -97,7 +105,7 @@ namespace System.Net { if (p.ContainsKey (port)) { epl = (EndPointListener) p [port]; } else { - epl = new EndPointListener (addr, port, secure); + epl = new EndPointListener (listener, addr, port, secure); p [port] = epl; } @@ -148,5 +156,4 @@ namespace System.Net { } } } -#endif