[Modify] Throw InvalidOperationException

This commit is contained in:
sta 2017-08-22 16:36:11 +09:00
parent 065aab72c4
commit c03fb0dc0c

View File

@ -1440,12 +1440,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>
@ -1462,7 +1456,15 @@ namespace WebSocketSharp.Server
/// </para> /// </para>
/// </exception> /// </exception>
/// <exception cref="InvalidOperationException"> /// <exception cref="InvalidOperationException">
/// <para>
/// The session could not be found.
/// </para>
/// <para>
/// -or-
/// </para>
/// <para>
/// The current state of the WebSocket connection is not Open. /// The current state of the WebSocket connection is not Open.
/// </para>
/// </exception> /// </exception>
public void SendToAsync ( public void SendToAsync (
Stream stream, int length, string id, Action<bool> completed Stream stream, int length, string id, Action<bool> completed
@ -1471,7 +1473,7 @@ namespace WebSocketSharp.Server
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.SendAsync (stream, length, completed); session.Context.WebSocket.SendAsync (stream, length, completed);