[Modify] Throw exceptions
This commit is contained in:
parent
09673eb64e
commit
f37c761971
@ -535,14 +535,14 @@ namespace WebSocketSharp.Server
|
|||||||
/// </param>
|
/// </param>
|
||||||
public void Broadcast (byte[] data)
|
public void Broadcast (byte[] data)
|
||||||
{
|
{
|
||||||
var msg = _state.CheckIfAvailable (false, true, false) ??
|
if (_state != ServerState.Start) {
|
||||||
WebSocket.CheckSendParameter (data);
|
var msg = "The current state of the manager is not Start.";
|
||||||
|
throw new InvalidOperationException (msg);
|
||||||
if (msg != null) {
|
|
||||||
_logger.Error (msg);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data == null)
|
||||||
|
throw new ArgumentNullException ("data");
|
||||||
|
|
||||||
if (data.LongLength <= WebSocket.FragmentLength)
|
if (data.LongLength <= WebSocket.FragmentLength)
|
||||||
broadcast (Opcode.Binary, data, null);
|
broadcast (Opcode.Binary, data, null);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user