Fix for issue #103, replaced the getEndPointListener (IPAddress, int, bool, HttpListener) method with the getEndPointListener (string, int, HttpListener, bool) method, to be same as the latest Mono

This commit is contained in:
sta 2015-02-17 17:32:31 +09:00
parent d8df50efef
commit 168c550370

View File

@ -87,8 +87,8 @@ namespace WebSocketSharp.Net
if (pref.Path.IndexOf ("//", StringComparison.Ordinal) != -1)
throw new HttpListenerException (400, "Invalid path."); // TODO: Code?
// Always listens on all the interfaces, no matter the host name/ip used.
var epl = getEndPointListener (IPAddress.Any, pref.Port, pref.IsSecure, httpListener);
// listens on all the interfaces if host name cannot be parsed by IPAddress.
var epl = getEndPointListener (pref.Host, pref.Port, httpListener, pref.IsSecure);
epl.AddPrefix (pref, httpListener);
}
@ -179,7 +179,7 @@ namespace WebSocketSharp.Net
if (pref.Path.IndexOf ("//", StringComparison.Ordinal) != -1)
return;
var epl = getEndPointListener (IPAddress.Any, pref.Port, pref.IsSecure, httpListener);
var epl = getEndPointListener (pref.Host, pref.Port, httpListener, pref.IsSecure);
epl.RemovePrefix (pref, httpListener);
}