[Modify] Throw InvalidOperationException

master
sta 8 years ago
parent c4fcf530bc
commit acf89bad96

@ -1106,25 +1106,25 @@ namespace WebSocketSharp.Server
/// </para> /// </para>
/// </exception> /// </exception>
/// <exception cref="ArgumentException"> /// <exception cref="ArgumentException">
/// <para>
/// <paramref name="id"/> is an empty string. /// <paramref name="id"/> is an empty string.
/// </exception>
/// <exception cref="InvalidOperationException">
/// <para>
/// The session could not be found.
/// </para> /// </para>
/// <para> /// <para>
/// -or- /// -or-
/// </para> /// </para>
/// <para> /// <para>
/// The session could not be found.
/// </para>
/// </exception>
/// <exception cref="InvalidOperationException">
/// 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 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);

Loading…
Cancel
Save