[Modify] Throw exception
This commit is contained in:
parent
ea19c5d94a
commit
e64daf6d81
@ -1148,7 +1148,11 @@ namespace WebSocketSharp.Server
|
|||||||
public void SendToAsync (string data, string id, Action<bool> completed)
|
public void SendToAsync (string data, string id, Action<bool> completed)
|
||||||
{
|
{
|
||||||
IWebSocketSession session;
|
IWebSocketSession session;
|
||||||
if (TryGetSession (id, out session))
|
if (!TryGetSession (id, out session)) {
|
||||||
|
var msg = "The session could not be found.";
|
||||||
|
throw new ArgumentException (msg, "id");
|
||||||
|
}
|
||||||
|
|
||||||
session.Context.WebSocket.SendAsync (data, completed);
|
session.Context.WebSocket.SendAsync (data, completed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user