diff --git a/websocket-sharp/Server/WebSocketServer.cs b/websocket-sharp/Server/WebSocketServer.cs index b858f4a6..35498220 100644 --- a/websocket-sharp/Server/WebSocketServer.cs +++ b/websocket-sharp/Server/WebSocketServer.cs @@ -956,7 +956,14 @@ namespace WebSocketSharp.Server ); } - _listener.Start (); + try { + _listener.Start (); + } + catch (Exception ex) { + var msg = "The underlying listener has failed to start."; + throw new InvalidOperationException (msg, ex); + } + _receiveThread = new Thread (new ThreadStart (receiveRequest)); _receiveThread.IsBackground = true; _receiveThread.Start (); @@ -1310,9 +1317,12 @@ namespace WebSocketSharp.Server /// /// There is no certificate in the configuration. /// - /// - /// - /// The underlying has failed to start. + /// + /// -or- + /// + /// + /// The underlying has failed to start. + /// /// public void Start () {