[Modify] Throw InvalidOperationException

This commit is contained in:
sta 2017-08-20 16:18:05 +09:00
parent d45dc22376
commit 4748abe65b

View File

@ -1218,12 +1218,6 @@ namespace WebSocketSharp.Server
/// -or- /// -or-
/// </para> /// </para>
/// <para> /// <para>
/// The session could not be found.
/// </para>
/// <para>
/// -or-
/// </para>
/// <para>
/// <paramref name="stream"/> cannot be read. /// <paramref name="stream"/> cannot be read.
/// </para> /// </para>
/// <para> /// <para>
@ -1240,14 +1234,22 @@ namespace WebSocketSharp.Server
/// </para> /// </para>
/// </exception> /// </exception>
/// <exception cref="InvalidOperationException"> /// <exception cref="InvalidOperationException">
/// The current state of the WebSocket connection is not Open. /// <para>
/// The session could not be found.
/// </para>
/// <para>
/// -or-
/// </para>
/// <para>
/// The current state of the WebSocket connection is not Open.
/// </para>
/// </exception> /// </exception>
public void SendTo (Stream stream, int length, string id) public void SendTo (Stream stream, int length, 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 (stream, length); session.Context.WebSocket.Send (stream, length);