[Modify] Throw exception
This commit is contained in:
parent
29cfc7e124
commit
38c8e4117f
@ -842,7 +842,11 @@ namespace WebSocketSharp.Server
|
|||||||
public void CloseSession (string id)
|
public void CloseSession (string id)
|
||||||
{
|
{
|
||||||
IWebSocketSession session;
|
IWebSocketSession session;
|
||||||
if (TryGetSession (id, out session))
|
if (!TryGetSession (id, out session)) {
|
||||||
|
var msg = "The session could not be found.";
|
||||||
|
throw new ArgumentException (msg, "id");
|
||||||
|
}
|
||||||
|
|
||||||
session.Context.WebSocket.Close ();
|
session.Context.WebSocket.Close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user