[Modify] Throw exception

This commit is contained in:
sta 2017-08-02 15:40:35 +09:00
parent 3a6b0de5b3
commit 862eb79f51

View File

@ -566,10 +566,9 @@ namespace WebSocketSharp.Server
/// </returns>
public Dictionary<string, bool> Broadping ()
{
var msg = _state.CheckIfAvailable (false, true, false);
if (msg != null) {
_logger.Error (msg);
return null;
if (_state != ServerState.Start) {
var msg = "The current state of the manager is not Start.";
throw new InvalidOperationException (msg);
}
return Broadping (WebSocketFrame.EmptyPingBytes, _waitTime);