[Modify] Polish it

This commit is contained in:
sta 2017-06-17 15:33:04 +09:00
parent be58cb2ff3
commit 50f76522cc

View File

@ -840,16 +840,22 @@ namespace WebSocketSharp.Server
return uri.HostNameType == UriHostNameType.IPv6 ? uri.Host : uri.DnsSafeHost; return uri.HostNameType == UriHostNameType.IPv6 ? uri.Host : uri.DnsSafeHost;
} }
private void init (string hostname, System.Net.IPAddress address, int port, bool secure) private void init (
string hostname, System.Net.IPAddress address, int port, bool secure
)
{ {
_hostname = hostname ?? convertToString (address); _hostname = hostname ?? convertToString (address);
_address = address; _address = address;
_port = port; _port = port;
_secure = secure; _secure = secure;
_listener = new HttpListener (); var lsnr = new HttpListener ();
_listener.Prefixes.Add ( var pref = String.Format (
String.Format ("http{0}://{1}:{2}/", secure ? "s" : "", _hostname, port)); "http{0}://{1}:{2}/", secure ? "s" : "", _hostname, port
);
lsnr.Prefixes.Add (pref);
_listener = lsnr;
_log = _listener.Log; _log = _listener.Log;
_rootPath = "./Public"; _rootPath = "./Public";