[Modify] Throw exception

This commit is contained in:
sta 2018-05-17 19:29:52 +09:00
parent dc14d57083
commit 5782dd198e

View File

@ -521,8 +521,12 @@ namespace WebSocketSharp.Server
/// </param>
protected void Send (string data)
{
if (_websocket != null)
_websocket.Send (data);
if (_websocket == null) {
var msg = "The current state of the connection is not Open.";
throw new InvalidOperationException (msg);
}
_websocket.Send (data);
}
/// <summary>