diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index 37d544fc..ba7ae37d 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -1009,7 +1009,14 @@ namespace WebSocketSharp.Server private void startReceiving () { - _listener.Start (); + try { + _listener.Start (); + } + catch (Exception ex) { + var msg = "The underlying HttpListener has failed to start."; + throw new InvalidOperationException (msg, ex); + } + _receiveThread = new Thread (new ThreadStart (receiveRequest)); _receiveThread.IsBackground = true; _receiveThread.Start (); @@ -1439,7 +1446,15 @@ namespace WebSocketSharp.Server /// started or it is shutting down. /// /// - /// There is no certificate used to authenticate the server. + /// + /// There is no certificate used to authenticate the server. + /// + /// + /// -or- + /// + /// + /// The underlying has failed to start. + /// /// public void Start () {