Renamed Sweeped property to Sweeping
This commit is contained in:
@@ -121,19 +121,20 @@ namespace WebSocketSharp.Server {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the server cleans up the inactive WebSocket service instances periodically.
|
||||
/// Gets or sets a value indicating whether the server cleans up the inactive WebSocket service
|
||||
/// instances periodically.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if the server cleans up the inactive WebSocket service instances every 60 seconds;
|
||||
/// otherwise, <c>false</c>. The default value is <c>true</c>.
|
||||
/// </value>
|
||||
public bool Sweeped {
|
||||
public bool Sweeping {
|
||||
get {
|
||||
return _svcHosts.Sweeped;
|
||||
return _svcHosts.Sweeping;
|
||||
}
|
||||
|
||||
set {
|
||||
_svcHosts.Sweeped = value;
|
||||
_svcHosts.Sweeping = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,8 +392,8 @@ namespace WebSocketSharp.Server {
|
||||
|
||||
var svcHost = new WebSocketServiceHost<T>();
|
||||
svcHost.Uri = absPath.ToUri();
|
||||
if (!Sweeped)
|
||||
svcHost.Sweeped = Sweeped;
|
||||
if (!Sweeping)
|
||||
svcHost.Sweeping = false;
|
||||
|
||||
_svcHosts.Add(absPath, svcHost);
|
||||
}
|
||||
|
@@ -32,19 +32,21 @@ using WebSocketSharp.Net.WebSockets;
|
||||
namespace WebSocketSharp.Server {
|
||||
|
||||
/// <summary>
|
||||
/// Exposes the methods and property for the host that provides a <see cref="WebSocketService"/>.
|
||||
/// Exposes the methods and properties for the WebSocket service host.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
public interface IServiceHost {
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service clients periodically.
|
||||
/// Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service
|
||||
/// instances periodically.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if the WebSocket service host cleans up the inactive service clients periodically; otherwise, <c>false</c>.
|
||||
/// <c>true</c> if the WebSocket service host cleans up the inactive service instances periodically;
|
||||
/// otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
bool Sweeped { get; set; }
|
||||
bool Sweeping { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Binds the specified <see cref="WebSocketContext"/> to a <see cref="WebSocketService"/> instance.
|
||||
|
@@ -36,7 +36,7 @@ namespace WebSocketSharp.Server {
|
||||
#region Private Fields
|
||||
|
||||
private Dictionary<string, IServiceHost> _svcHosts;
|
||||
private bool _sweeped;
|
||||
private bool _sweeping;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace WebSocketSharp.Server {
|
||||
public ServiceHostManager()
|
||||
{
|
||||
_svcHosts = new Dictionary<string, IServiceHost>();
|
||||
_sweeped = true;
|
||||
_sweeping = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -70,17 +70,17 @@ namespace WebSocketSharp.Server {
|
||||
}
|
||||
}
|
||||
|
||||
public bool Sweeped {
|
||||
public bool Sweeping {
|
||||
get {
|
||||
return _sweeped;
|
||||
return _sweeping;
|
||||
}
|
||||
|
||||
set {
|
||||
if (_sweeped ^ value)
|
||||
if (_sweeping ^ value)
|
||||
{
|
||||
_sweeped = value;
|
||||
_sweeping = value;
|
||||
foreach (var svcHost in _svcHosts.Values)
|
||||
svcHost.Sweeped = value;
|
||||
svcHost.Sweeping = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -161,19 +161,20 @@ namespace WebSocketSharp.Server {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the server cleans up the inactive clients periodically.
|
||||
/// Gets or sets a value indicating whether the server cleans up the inactive WebSocket service
|
||||
/// instances periodically.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if the server cleans up the inactive clients every 60 seconds; otherwise, <c>false</c>.
|
||||
/// The default value is <c>true</c>.
|
||||
/// <c>true</c> if the server cleans up the inactive WebSocket service instances every 60 seconds;
|
||||
/// otherwise, <c>false</c>. The default value is <c>true</c>.
|
||||
/// </value>
|
||||
public bool Sweeped {
|
||||
public bool Sweeping {
|
||||
get {
|
||||
return _svcHosts.Sweeped;
|
||||
return _svcHosts.Sweeping;
|
||||
}
|
||||
|
||||
set {
|
||||
_svcHosts.Sweeped = value;
|
||||
_svcHosts.Sweeping = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,8 +242,8 @@ namespace WebSocketSharp.Server {
|
||||
svcHost.Uri = BaseUri.IsAbsoluteUri
|
||||
? new Uri(BaseUri, absPath)
|
||||
: absPath.ToUri();
|
||||
if (!Sweeped)
|
||||
svcHost.Sweeped = Sweeped;
|
||||
if (!Sweeping)
|
||||
svcHost.Sweeping = false;
|
||||
|
||||
_svcHosts.Add(absPath, svcHost);
|
||||
}
|
||||
|
@@ -183,19 +183,20 @@ namespace WebSocketSharp.Server {
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the server cleans up the inactive clients periodically.
|
||||
/// Gets or sets a value indicating whether the server cleans up the inactive WebSocket service
|
||||
/// instances periodically.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if the server cleans up the inactive clients every 60 seconds; otherwise, <c>false</c>.
|
||||
/// The default value is <c>true</c>.
|
||||
/// <c>true</c> if the server cleans up the inactive WebSocket service instances every 60 seconds;
|
||||
/// otherwise, <c>false</c>. The default value is <c>true</c>.
|
||||
/// </value>
|
||||
public bool Sweeped {
|
||||
public bool Sweeping {
|
||||
get {
|
||||
return _sessions.Sweeped;
|
||||
return _sessions.Sweeping;
|
||||
}
|
||||
|
||||
set {
|
||||
_sessions.Sweeped = value;
|
||||
_sessions.Sweeping = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +238,7 @@ namespace WebSocketSharp.Server {
|
||||
protected override void AcceptWebSocket(TcpListenerWebSocketContext context)
|
||||
{
|
||||
var websocket = context.WebSocket;
|
||||
var path = context.Path.UrlDecode();
|
||||
var path = context.Path.UrlDecode();
|
||||
if (path != Uri.GetAbsolutePath().UrlDecode())
|
||||
{
|
||||
websocket.Close(HttpStatusCode.NotImplemented);
|
||||
|
@@ -138,7 +138,7 @@ namespace WebSocketSharp.Server {
|
||||
/// <c>true</c> if the <see cref="WebSocketServiceManager"/> cleans up the inactive <see cref="WebSocketService"/> objects
|
||||
/// every 60 seconds; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public bool Sweeped {
|
||||
public bool Sweeping {
|
||||
get {
|
||||
return _sweepTimer.Enabled;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ namespace WebSocketSharp.Server {
|
||||
|
||||
private void startSweepTimer()
|
||||
{
|
||||
if (!Sweeped)
|
||||
if (!_sweepTimer.Enabled)
|
||||
_sweepTimer.Start();
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace WebSocketSharp.Server {
|
||||
|
||||
private void stopSweepTimer()
|
||||
{
|
||||
if (Sweeped)
|
||||
if (_sweepTimer.Enabled)
|
||||
_sweepTimer.Stop();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user