[Modify] Throw exception
This commit is contained in:
parent
32ba638d4b
commit
a01c2354e1
@ -696,7 +696,11 @@ namespace WebSocketSharp.Server
|
|||||||
/// </param>
|
/// </param>
|
||||||
protected void SendAsync (Stream stream, int length, Action<bool> completed)
|
protected void SendAsync (Stream stream, int length, 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 (stream, length, completed);
|
_websocket.SendAsync (stream, length, completed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user