[Modify] Throw exception
This commit is contained in:
parent
49565452f0
commit
7df9640514
@ -461,8 +461,12 @@ namespace WebSocketSharp.Server
|
|||||||
/// </param>
|
/// </param>
|
||||||
protected void Send (byte[] data)
|
protected void Send (byte[] data)
|
||||||
{
|
{
|
||||||
if (_websocket != null)
|
if (_websocket == null) {
|
||||||
_websocket.Send (data);
|
var msg = "The current state of the connection is not Open.";
|
||||||
|
throw new InvalidOperationException (msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
_websocket.Send (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user