[Modify] Polish it
This commit is contained in:
parent
29c6bb4745
commit
544df68e13
@ -240,13 +240,17 @@ namespace WebSocketSharp.Server
|
|||||||
/// </value>
|
/// </value>
|
||||||
public IEnumerable<IWebSocketSession> Sessions {
|
public IEnumerable<IWebSocketSession> Sessions {
|
||||||
get {
|
get {
|
||||||
if (_state == ServerState.ShuttingDown)
|
if (_state != ServerState.Start)
|
||||||
return new IWebSocketSession[0];
|
return Enumerable.Empty<IWebSocketSession> ();
|
||||||
|
|
||||||
|
lock (_sync) {
|
||||||
|
if (_state != ServerState.Start)
|
||||||
|
return Enumerable.Empty<IWebSocketSession> ();
|
||||||
|
|
||||||
lock (_sync)
|
|
||||||
return _sessions.Values.ToList ();
|
return _sessions.Values.ToList ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the wait time for the response to the WebSocket Ping or Close.
|
/// Gets the wait time for the response to the WebSocket Ping or Close.
|
||||||
|
Loading…
Reference in New Issue
Block a user