[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-
/// </para>
/// <para>
/// The session could not be found.
/// </para>
/// <para>
/// -or-
/// </para>
/// <para>
/// <paramref name="stream"/> cannot be read.
/// </para>
/// <para>
@ -1462,7 +1456,15 @@ namespace WebSocketSharp.Server
/// </para>
/// </exception>
/// <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>
public void SendToAsync (
Stream stream, int length, string id, Action<bool> completed
@ -1471,7 +1473,7 @@ namespace WebSocketSharp.Server
IWebSocketSession session;
if (!TryGetSession (id, out session)) {
var msg = "The session could not be found.";
throw new ArgumentException (msg, "id");
throw new InvalidOperationException (msg);
}
session.Context.WebSocket.SendAsync (stream, length, completed);