[Modify] Polish it
This commit is contained in:
@@ -1543,12 +1543,14 @@ namespace WebSocketSharp.Server
|
|||||||
{
|
{
|
||||||
if (_sweeping) {
|
if (_sweeping) {
|
||||||
_log.Info ("The sweeping is already in progress.");
|
_log.Info ("The sweeping is already in progress.");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (_forSweep) {
|
lock (_forSweep) {
|
||||||
if (_sweeping) {
|
if (_sweeping) {
|
||||||
_log.Info ("The sweeping is already in progress.");
|
_log.Info ("The sweeping is already in progress.");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1564,8 +1566,10 @@ namespace WebSocketSharp.Server
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
IWebSocketSession session;
|
IWebSocketSession session;
|
||||||
|
|
||||||
if (_sessions.TryGetValue (id, out session)) {
|
if (_sessions.TryGetValue (id, out session)) {
|
||||||
var state = session.ConnectionState;
|
var state = session.ConnectionState;
|
||||||
|
|
||||||
if (state == WebSocketState.Open)
|
if (state == WebSocketState.Open)
|
||||||
session.Context.WebSocket.Close (CloseStatusCode.Abnormal);
|
session.Context.WebSocket.Close (CloseStatusCode.Abnormal);
|
||||||
else if (state == WebSocketState.Closing)
|
else if (state == WebSocketState.Closing)
|
||||||
|
Reference in New Issue
Block a user