[Modify] Throw exception

This commit is contained in:
sta 2017-08-11 17:13:25 +09:00
parent 73900290cd
commit 82981391c8

View File

@ -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>