[Modify] Throw InvalidOperationException

This commit is contained in:
sta 2017-08-20 16:00:32 +09:00
parent c4fcf530bc
commit acf89bad96

View File

@ -1106,25 +1106,25 @@ namespace WebSocketSharp.Server
/// </para> /// </para>
/// </exception> /// </exception>
/// <exception cref="ArgumentException"> /// <exception cref="ArgumentException">
/// <paramref name="id"/> is an empty string.
/// </exception>
/// <exception cref="InvalidOperationException">
/// <para> /// <para>
/// <paramref name="id"/> is an empty string. /// The session could not be found.
/// </para> /// </para>
/// <para> /// <para>
/// -or- /// -or-
/// </para> /// </para>
/// <para> /// <para>
/// The session could not be found. /// The current state of the WebSocket connection is not Open.
/// </para> /// </para>
/// </exception> /// </exception>
/// <exception cref="InvalidOperationException">
/// The current state of the WebSocket connection is not Open.
/// </exception>
public void SendTo (byte[] data, string id) public void SendTo (byte[] data, string id)
{ {
IWebSocketSession session; IWebSocketSession session;
if (!TryGetSession (id, out session)) { if (!TryGetSession (id, out session)) {
var msg = "The session could not be found."; var msg = "The session could not be found.";
throw new ArgumentException (msg, "id"); throw new InvalidOperationException (msg);
} }
session.Context.WebSocket.Send (data); session.Context.WebSocket.Send (data);