[Modify] Polish it

This commit is contained in:
sta 2017-09-09 17:41:32 +09:00
parent cea3ac8a81
commit 49a4c40de6

View File

@ -30,6 +30,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Timers;
@ -132,13 +133,17 @@ namespace WebSocketSharp.Server
/// </value>
public IEnumerable<string> IDs {
get {
if (_state == ServerState.ShuttingDown)
return new string[0];
if (_state != ServerState.Start)
return Enumerable.Empty<string> ();
lock (_sync) {
if (_state != ServerState.Start)
return Enumerable.Empty<string> ();
lock (_sync)
return _sessions.Keys.ToList ();
}
}
}
/// <summary>
/// Gets the IDs for the inactive sessions in the WebSocket service.