Skip to content

Commit 49a4c40

Browse files
committed
[Modify] Polish it
1 parent cea3ac8 commit 49a4c40

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

websocket-sharp/Server/WebSocketSessionManager.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
using System.Collections;
3131
using System.Collections.Generic;
3232
using System.IO;
33+
using System.Linq;
3334
using System.Text;
3435
using System.Threading;
3536
using System.Timers;
@@ -132,11 +133,15 @@ public int Count {
132133
/// </value>
133134
public IEnumerable<string> IDs {
134135
get {
135-
if (_state == ServerState.ShuttingDown)
136-
return new string[0];
136+
if (_state != ServerState.Start)
137+
return Enumerable.Empty<string> ();
138+
139+
lock (_sync) {
140+
if (_state != ServerState.Start)
141+
return Enumerable.Empty<string> ();
137142

138-
lock (_sync)
139143
return _sessions.Keys.ToList ();
144+
}
140145
}
141146
}
142147

0 commit comments

Comments
 (0)