[Modify] Rethrow it

This commit is contained in:
sta 2017-07-13 17:12:50 +09:00
parent 5dab7521e5
commit ed12ccaf21

View File

@ -1026,7 +1026,14 @@ namespace WebSocketSharp.Server
private void stopReceiving (int millisecondsTimeout) private void stopReceiving (int millisecondsTimeout)
{ {
try {
_listener.Stop (); _listener.Stop ();
}
catch (Exception ex) {
var msg = "The underlying listener has failed to stop.";
throw new InvalidOperationException (msg, ex);
}
_receiveThread.Join (millisecondsTimeout); _receiveThread.Join (millisecondsTimeout);
} }
@ -1343,7 +1350,7 @@ namespace WebSocketSharp.Server
/// This method does nothing if the server is not started, /// This method does nothing if the server is not started,
/// it is shutting down, or it has already stopped. /// it is shutting down, or it has already stopped.
/// </remarks> /// </remarks>
/// <exception cref="SocketException"> /// <exception cref="InvalidOperationException">
/// The underlying <see cref="TcpListener"/> has failed to stop. /// The underlying <see cref="TcpListener"/> has failed to stop.
/// </exception> /// </exception>
public void Stop () public void Stop ()
@ -1404,7 +1411,7 @@ namespace WebSocketSharp.Server
/// <paramref name="reason"/> could not be UTF-8-encoded. /// <paramref name="reason"/> could not be UTF-8-encoded.
/// </para> /// </para>
/// </exception> /// </exception>
/// <exception cref="SocketException"> /// <exception cref="InvalidOperationException">
/// The underlying <see cref="TcpListener"/> has failed to stop. /// The underlying <see cref="TcpListener"/> has failed to stop.
/// </exception> /// </exception>
public void Stop (ushort code, string reason) public void Stop (ushort code, string reason)
@ -1484,7 +1491,7 @@ namespace WebSocketSharp.Server
/// <paramref name="reason"/> could not be UTF-8-encoded. /// <paramref name="reason"/> could not be UTF-8-encoded.
/// </para> /// </para>
/// </exception> /// </exception>
/// <exception cref="SocketException"> /// <exception cref="InvalidOperationException">
/// The underlying <see cref="TcpListener"/> has failed to stop. /// The underlying <see cref="TcpListener"/> has failed to stop.
/// </exception> /// </exception>
public void Stop (CloseStatusCode code, string reason) public void Stop (CloseStatusCode code, string reason)