Fix due to the modified ServiceManager.cs

This commit is contained in:
sta
2012-11-02 17:55:00 +09:00
parent 746c883b82
commit 2addc16f91
30 changed files with 65 additions and 11 deletions

View File

@@ -27,6 +27,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
@@ -69,6 +70,12 @@ namespace WebSocketSharp.Server {
get { return _port; }
}
public IEnumerable<string> ServicePath {
get {
return _services.Path;
}
}
public bool Sweeped {
get {
return _services.Sweeped;
@@ -296,6 +303,10 @@ namespace WebSocketSharp.Server {
}
var svcHost = new WebSocketServiceHost<T>();
svcHost.Uri = absPath.ToUri();
if (!Sweeped)
svcHost.Sweeped = Sweeped;
_services.Add(absPath, svcHost);
}

View File

@@ -64,7 +64,7 @@ namespace WebSocketSharp.Server {
}
set {
if (value ^ _sweeped)
if (_sweeped ^ value)
{
_sweeped = value;
foreach (var svcHost in _services.Values)
@@ -73,6 +73,18 @@ namespace WebSocketSharp.Server {
}
}
public IEnumerable<string> Path {
get {
return _services.Keys;
}
}
public IEnumerable<IServiceHost> ServiceHost {
get {
return _services.Values;
}
}
#endregion
#region Public Methods

View File

@@ -29,6 +29,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Net.Sockets;
using WebSocketSharp.Net;
@@ -76,6 +77,16 @@ namespace WebSocketSharp.Server {
#region Property
public IEnumerable<string> ServicePath {
get {
var url = BaseUri.IsAbsoluteUri
? BaseUri.ToString().TrimEnd('/')
: String.Empty;
foreach (var path in _services.Path)
yield return url + path;
}
}
public bool Sweeped {
get {
return _services.Sweeped;
@@ -133,6 +144,12 @@ namespace WebSocketSharp.Server {
}
var svcHost = new WebSocketServiceHost<T>();
svcHost.Uri = BaseUri.IsAbsoluteUri
? new Uri(BaseUri, absPath)
: absPath.ToUri();
if (!Sweeped)
svcHost.Sweeped = Sweeped;
_services.Add(absPath, svcHost);
}

View File

@@ -100,6 +100,10 @@ namespace WebSocketSharp.Server {
get {
return _uri;
}
set {
_uri = value;
}
}
#endregion

View File

@@ -95,6 +95,10 @@ namespace WebSocketSharp.Server {
get {
return BaseUri;
}
internal set {
BaseUri = value;
}
}
#endregion
@@ -122,7 +126,7 @@ namespace WebSocketSharp.Server {
}
if (Uri.IsAbsoluteUri)
socket.Url = new Uri(Uri, path);
socket.Url = Uri;
BindWebSocket(socket);
}

Binary file not shown.