[Modify] Throw exception

This commit is contained in:
sta 2018-05-23 19:02:37 +09:00
parent 612ea7f7e2
commit 74cd02dace

View File

@ -596,7 +596,11 @@ namespace WebSocketSharp.Server
/// </param>
protected void SendAsync (FileInfo file, Action<bool> completed)
{
if (_websocket != null)
if (_websocket == null) {
var msg = "The current state of the connection is not Open.";
throw new InvalidOperationException (msg);
}
_websocket.SendAsync (file, completed);
}