[Modify] Throw exception

This commit is contained in:
sta 2018-05-13 20:00:11 +09:00
parent 49565452f0
commit 7df9640514

View File

@ -461,7 +461,11 @@ namespace WebSocketSharp.Server
/// </param>
protected void Send (byte[] data)
{
if (_websocket != null)
if (_websocket == null) {
var msg = "The current state of the connection is not Open.";
throw new InvalidOperationException (msg);
}
_websocket.Send (data);
}