[Modify] Throw exception

This commit is contained in:
sta 2018-05-21 20:01:28 +09:00
parent 11b49fc673
commit c7baf97417

View File

@ -556,8 +556,12 @@ namespace WebSocketSharp.Server
/// </param>
protected void SendAsync (byte[] data, Action<bool> completed)
{
if (_websocket != null)
_websocket.SendAsync (data, completed);
if (_websocket == null) {
var msg = "The current state of the connection is not Open.";
throw new InvalidOperationException (msg);
}
_websocket.SendAsync (data, completed);
}
/// <summary>