Renamed the Sweeping property to the KeepClean property
This commit is contained in:
parent
ef17cabdd3
commit
df2726ce9d
@ -26,7 +26,7 @@ namespace Example2 {
|
||||
#if DEBUG
|
||||
wssv.Log.Level = LogLevel.TRACE;
|
||||
#endif
|
||||
//wssv.Sweeping = false;
|
||||
//wssv.KeepClean = false;
|
||||
|
||||
wssv.Start ();
|
||||
Console.WriteLine (
|
||||
@ -45,7 +45,7 @@ namespace Example2 {
|
||||
//var file = ConfigurationManager.AppSettings ["ServerCertFile"];
|
||||
//var password = ConfigurationManager.AppSettings ["CertFilePassword"];
|
||||
//wssv.Certificate = new X509Certificate2 (file, password);
|
||||
//wssv.Sweeping = false;
|
||||
//wssv.KeepClean = false;
|
||||
wssv.AddWebSocketService<Echo> ("/Echo");
|
||||
wssv.AddWebSocketService<Chat> ("/Chat");
|
||||
//wssv.AddWebSocketService<Echo> ("/エコー");
|
||||
|
@ -17,7 +17,7 @@ namespace Example3
|
||||
_httpsv.Log.Level = LogLevel.TRACE;
|
||||
#endif
|
||||
_httpsv.RootPath = ConfigurationManager.AppSettings ["RootPath"];
|
||||
//_httpsv.Sweeping = false;
|
||||
//_httpsv.KeepClean = false;
|
||||
_httpsv.AddWebSocketService<Echo> ("/Echo");
|
||||
_httpsv.AddWebSocketService<Chat> ("/Chat");
|
||||
|
||||
|
@ -96,6 +96,24 @@ namespace WebSocketSharp.Server
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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 KeepClean {
|
||||
get {
|
||||
return _svcHosts.KeepClean;
|
||||
}
|
||||
|
||||
set {
|
||||
_svcHosts.KeepClean = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the logging functions.
|
||||
/// </summary>
|
||||
@ -155,24 +173,6 @@ namespace WebSocketSharp.Server
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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 Sweeping {
|
||||
get {
|
||||
return _svcHosts.Sweeping;
|
||||
}
|
||||
|
||||
set {
|
||||
_svcHosts.Sweeping = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Events
|
||||
@ -412,8 +412,8 @@ namespace WebSocketSharp.Server
|
||||
|
||||
var svcHost = new WebSocketServiceHost<T> (_logger);
|
||||
svcHost.Uri = absPath.ToUri ();
|
||||
if (!Sweeping)
|
||||
svcHost.Sweeping = false;
|
||||
if (!KeepClean)
|
||||
svcHost.KeepClean = false;
|
||||
|
||||
_svcHosts.Add (absPath, svcHost);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ namespace WebSocketSharp.Server {
|
||||
/// <c>true</c> if the WebSocket service host cleans up the inactive service instances periodically;
|
||||
/// otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
bool Sweeping { get; set; }
|
||||
bool KeepClean { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Binds the specified <see cref="WebSocketContext"/> to a <see cref="WebSocketService"/> instance.
|
||||
|
@ -35,8 +35,8 @@ namespace WebSocketSharp.Server {
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool _keepClean;
|
||||
private Dictionary<string, IServiceHost> _svcHosts;
|
||||
private bool _sweeping;
|
||||
|
||||
#endregion
|
||||
|
||||
@ -44,8 +44,8 @@ namespace WebSocketSharp.Server {
|
||||
|
||||
public ServiceHostManager()
|
||||
{
|
||||
_keepClean = true;
|
||||
_svcHosts = new Dictionary<string, IServiceHost>();
|
||||
_sweeping = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -58,6 +58,21 @@ namespace WebSocketSharp.Server {
|
||||
}
|
||||
}
|
||||
|
||||
public bool KeepClean {
|
||||
get {
|
||||
return _keepClean;
|
||||
}
|
||||
|
||||
set {
|
||||
if (_keepClean ^ value)
|
||||
{
|
||||
_keepClean = value;
|
||||
foreach (var svcHost in _svcHosts.Values)
|
||||
svcHost.KeepClean = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> Paths {
|
||||
get {
|
||||
return _svcHosts.Keys;
|
||||
@ -70,21 +85,6 @@ namespace WebSocketSharp.Server {
|
||||
}
|
||||
}
|
||||
|
||||
public bool Sweeping {
|
||||
get {
|
||||
return _sweeping;
|
||||
}
|
||||
|
||||
set {
|
||||
if (_sweeping ^ value)
|
||||
{
|
||||
_sweeping = value;
|
||||
foreach (var svcHost in _svcHosts.Values)
|
||||
svcHost.Sweeping = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
@ -144,6 +144,24 @@ namespace WebSocketSharp.Server {
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// 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 KeepClean {
|
||||
get {
|
||||
return _svcHosts.KeepClean;
|
||||
}
|
||||
|
||||
set {
|
||||
_svcHosts.KeepClean = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of paths associated with the every WebSocket services that the server provides.
|
||||
/// </summary>
|
||||
@ -161,24 +179,6 @@ namespace WebSocketSharp.Server {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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 Sweeping {
|
||||
get {
|
||||
return _svcHosts.Sweeping;
|
||||
}
|
||||
|
||||
set {
|
||||
_svcHosts.Sweeping = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected Methods
|
||||
@ -238,8 +238,8 @@ namespace WebSocketSharp.Server {
|
||||
? new Uri(BaseUri, absPath)
|
||||
: absPath.ToUri();
|
||||
|
||||
if (!Sweeping)
|
||||
svcHost.Sweeping = false;
|
||||
if (!KeepClean)
|
||||
svcHost.KeepClean = false;
|
||||
|
||||
_svcHosts.Add(absPath, svcHost);
|
||||
}
|
||||
|
@ -191,13 +191,13 @@ namespace WebSocketSharp.Server {
|
||||
/// <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 Sweeping {
|
||||
public bool KeepClean {
|
||||
get {
|
||||
return _sessions.Sweeping;
|
||||
return _sessions.KeepClean;
|
||||
}
|
||||
|
||||
set {
|
||||
_sessions.Sweeping = value;
|
||||
_sessions.KeepClean = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,10 +138,10 @@ namespace WebSocketSharp.Server
|
||||
/// the inactive <see cref="WebSocketService"/> instances periodically.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if the <see cref="WebSocketServiceManager"/> cleans up
|
||||
/// the inactive <see cref="WebSocketService"/> instances every 60 seconds; otherwise, <c>false</c>.
|
||||
/// <c>true</c> if the <see cref="WebSocketServiceManager"/> cleans up the inactive
|
||||
/// <see cref="WebSocketService"/> instances every 60 seconds; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public bool Sweeping {
|
||||
public bool KeepClean {
|
||||
get {
|
||||
return _sweepTimer.Enabled;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user