|
|
|
@ -145,37 +145,37 @@ namespace WebSocketSharp.Server {
|
|
|
|
#region Public Properties
|
|
|
|
#region Public Properties
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the collection of paths associated with the every WebSocket services that the server provides.
|
|
|
|
/// Gets or sets a value indicating whether the server cleans up the inactive WebSocket service
|
|
|
|
|
|
|
|
/// instances periodically.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <value>
|
|
|
|
/// <value>
|
|
|
|
/// An IEnumerable<string> that contains the collection of paths.
|
|
|
|
/// <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>
|
|
|
|
/// </value>
|
|
|
|
public IEnumerable<string> ServicePaths {
|
|
|
|
public bool KeepClean {
|
|
|
|
get {
|
|
|
|
get {
|
|
|
|
var url = BaseUri.IsAbsoluteUri
|
|
|
|
return _svcHosts.KeepClean;
|
|
|
|
? BaseUri.ToString().TrimEnd('/')
|
|
|
|
}
|
|
|
|
: String.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var path in _svcHosts.Paths)
|
|
|
|
set {
|
|
|
|
yield return url + path;
|
|
|
|
_svcHosts.KeepClean = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets a value indicating whether the server cleans up the inactive WebSocket service
|
|
|
|
/// Gets the collection of paths associated with the every WebSocket services that the server provides.
|
|
|
|
/// instances periodically.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <value>
|
|
|
|
/// <value>
|
|
|
|
/// <c>true</c> if the server cleans up the inactive WebSocket service instances every 60 seconds;
|
|
|
|
/// An IEnumerable<string> that contains the collection of paths.
|
|
|
|
/// otherwise, <c>false</c>. The default value is <c>true</c>.
|
|
|
|
|
|
|
|
/// </value>
|
|
|
|
/// </value>
|
|
|
|
public bool Sweeping {
|
|
|
|
public IEnumerable<string> ServicePaths {
|
|
|
|
get {
|
|
|
|
get {
|
|
|
|
return _svcHosts.Sweeping;
|
|
|
|
var url = BaseUri.IsAbsoluteUri
|
|
|
|
}
|
|
|
|
? BaseUri.ToString().TrimEnd('/')
|
|
|
|
|
|
|
|
: String.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
set {
|
|
|
|
foreach (var path in _svcHosts.Paths)
|
|
|
|
_svcHosts.Sweeping = value;
|
|
|
|
yield return url + path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -238,8 +238,8 @@ namespace WebSocketSharp.Server {
|
|
|
|
? new Uri(BaseUri, absPath)
|
|
|
|
? new Uri(BaseUri, absPath)
|
|
|
|
: absPath.ToUri();
|
|
|
|
: absPath.ToUri();
|
|
|
|
|
|
|
|
|
|
|
|
if (!Sweeping)
|
|
|
|
if (!KeepClean)
|
|
|
|
svcHost.Sweeping = false;
|
|
|
|
svcHost.KeepClean = false;
|
|
|
|
|
|
|
|
|
|
|
|
_svcHosts.Add(absPath, svcHost);
|
|
|
|
_svcHosts.Add(absPath, svcHost);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|