[Modify] Throw InvalidOperationException

master
sta 8 years ago
parent c4fcf530bc
commit acf89bad96

@ -1106,25 +1106,25 @@ namespace WebSocketSharp.Server
/// </para>
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="id"/> is an empty string.
/// </exception>
/// <exception cref="InvalidOperationException">
/// <para>
/// <paramref name="id"/> is an empty string.
/// The session could not be found.
/// </para>
/// <para>
/// -or-
/// </para>
/// <para>
/// The session could not be found.
/// The current state of the WebSocket connection is not Open.
/// </para>
/// </exception>
/// <exception cref="InvalidOperationException">
/// The current state of the WebSocket connection is not Open.
/// </exception>
public void SendTo (byte[] data, string id)
{
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.Send (data);

Loading…
Cancel
Save