From d4fc8da7a88fe286322a1cec0cdf9a68e7402224 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 8 Jul 2015 15:00:38 +0900 Subject: [PATCH] Fix for pull request #115, added the HttpServer (System.Net.IPAddress, int) constructor --- Example3/Program.cs | 3 ++- websocket-sharp/Server/HttpServer.cs | 33 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Example3/Program.cs b/Example3/Program.cs index 7463a44d..d5ebcf9f 100644 --- a/Example3/Program.cs +++ b/Example3/Program.cs @@ -19,7 +19,8 @@ namespace Example3 */ var httpsv = new HttpServer (4649); //var httpsv = new HttpServer (5963, true); - //var httpsv = new HttpServer (System.Net.IPAddress.Parse ("127.0.0.1"), 4649, false); + //var httpsv = new HttpServer (System.Net.IPAddress.Parse ("127.0.0.1"), 4649); + //var httpsv = new HttpServer (System.Net.IPAddress.Parse ("127.0.0.1"), 5963, true); #if DEBUG // To change the logging level. httpsv.Log.Level = LogLevel.Trace; diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index 5fc139fd..ffdf5489 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -136,6 +136,39 @@ namespace WebSocketSharp.Server init ("*", port, secure); } + /// + /// Initializes a new instance of the class with + /// the specified and . + /// + /// + /// + /// An instance initialized by this constructor listens for the incoming + /// connection requests on . + /// + /// + /// If is 443, that instance provides a secure connection. + /// + /// + /// + /// A that represents the local IP address of the server. + /// + /// + /// An that represents the port number on which to listen. + /// + /// + /// is . + /// + /// + /// isn't a local IP address. + /// + /// + /// isn't between 1 and 65535 inclusive. + /// + public HttpServer (System.Net.IPAddress address, int port) + : this (address, port, port == 443) + { + } + /// /// Initializes a new instance of the class with /// the specified , ,