[Modify] Throw InvalidOperationException
This commit is contained in:
parent
acf89bad96
commit
d45dc22376
@ -1158,24 +1158,26 @@ namespace WebSocketSharp.Server
|
||||
/// -or-
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <paramref name="data"/> could not be UTF-8-encoded.
|
||||
/// </para>
|
||||
/// </exception>
|
||||
/// <exception cref="InvalidOperationException">
|
||||
/// <para>
|
||||
/// The session could not be found.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// -or-
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <paramref name="data"/> could not be UTF-8-encoded.
|
||||
/// 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 (string 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…
Reference in New Issue
Block a user