[Modify] Throw exception
This commit is contained in:
parent
73900290cd
commit
82981391c8
@ -932,7 +932,12 @@ namespace WebSocketSharp.Server
|
||||
public bool PingTo (string message, string id)
|
||||
{
|
||||
IWebSocketSession session;
|
||||
return TryGetSession (id, out session) && session.Context.WebSocket.Ping (message);
|
||||
if (!TryGetSession (id, out session)) {
|
||||
var msg = "The session could not be found.";
|
||||
throw new ArgumentException (msg, "id");
|
||||
}
|
||||
|
||||
return session.Context.WebSocket.Ping (message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user