[Modify] Polish it

This commit is contained in:
sta 2021-11-23 21:21:58 +09:00
parent 65f34f5307
commit 898d399c46

View File

@ -1543,12 +1543,14 @@ namespace WebSocketSharp.Server
{
if (_sweeping) {
_log.Info ("The sweeping is already in progress.");
return;
}
lock (_forSweep) {
if (_sweeping) {
_log.Info ("The sweeping is already in progress.");
return;
}
@ -1564,8 +1566,10 @@ namespace WebSocketSharp.Server
break;
IWebSocketSession session;
if (_sessions.TryGetValue (id, out session)) {
var state = session.ConnectionState;
if (state == WebSocketState.Open)
session.Context.WebSocket.Close (CloseStatusCode.Abnormal);
else if (state == WebSocketState.Closing)