From 589c88ff01c803fd0476f8d0d8c87c2885f81e30 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 5 Jul 2017 15:59:35 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Server/HttpServer.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index 39ef7b3f..939c6f0c 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -276,13 +276,15 @@ namespace WebSocketSharp.Server throw new ArgumentNullException ("address"); if (!address.IsLocal ()) - throw new ArgumentException ("Not a local IP address: " + address, "address"); + throw new ArgumentException ("Not a local IP address.", "address"); - if (!port.IsPortNumber ()) - throw new ArgumentOutOfRangeException ( - "port", "Not between 1 and 65535 inclusive: " + port); + if (!port.IsPortNumber ()) { + var msg = "Less than 1 or greater than 65535."; + throw new ArgumentOutOfRangeException ("port", msg); + } - init (null, address, port, secure); + var host = convertToString (address); + init (host, address, port, secure); } #endregion