[Modify] Throw exception

master
sta 8 years ago
parent dc14d57083
commit 5782dd198e

@ -521,8 +521,12 @@ namespace WebSocketSharp.Server
/// </param> /// </param>
protected void Send (string data) protected void Send (string 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…
Cancel
Save