From ed12ccaf21192d22cb9afd65f7aac938d3f6f81c Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 13 Jul 2017 17:12:50 +0900 Subject: [PATCH] [Modify] Rethrow it --- websocket-sharp/Server/WebSocketServer.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/websocket-sharp/Server/WebSocketServer.cs b/websocket-sharp/Server/WebSocketServer.cs index 35498220..6c2a2496 100644 --- a/websocket-sharp/Server/WebSocketServer.cs +++ b/websocket-sharp/Server/WebSocketServer.cs @@ -1026,7 +1026,14 @@ namespace WebSocketSharp.Server private void stopReceiving (int millisecondsTimeout) { - _listener.Stop (); + try { + _listener.Stop (); + } + catch (Exception ex) { + var msg = "The underlying listener has failed to stop."; + throw new InvalidOperationException (msg, ex); + } + _receiveThread.Join (millisecondsTimeout); } @@ -1343,7 +1350,7 @@ namespace WebSocketSharp.Server /// This method does nothing if the server is not started, /// it is shutting down, or it has already stopped. /// - /// + /// /// The underlying has failed to stop. /// public void Stop () @@ -1404,7 +1411,7 @@ namespace WebSocketSharp.Server /// could not be UTF-8-encoded. /// /// - /// + /// /// The underlying has failed to stop. /// public void Stop (ushort code, string reason) @@ -1484,7 +1491,7 @@ namespace WebSocketSharp.Server /// could not be UTF-8-encoded. /// /// - /// + /// /// The underlying has failed to stop. /// public void Stop (CloseStatusCode code, string reason)