Modified some classes in WebSocketSharp.Server namespace
This commit is contained in:
parent
b9c5c222ca
commit
5386431a2e
@ -62,12 +62,13 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private bool _isWindows;
|
|
||||||
private HttpListener _listener;
|
private HttpListener _listener;
|
||||||
|
private bool _listening;
|
||||||
private int _port;
|
private int _port;
|
||||||
private Thread _receiveRequestThread;
|
private Thread _receiveRequestThread;
|
||||||
private string _rootPath;
|
private string _rootPath;
|
||||||
private ServiceHostManager _svcHosts;
|
private ServiceHostManager _svcHosts;
|
||||||
|
private bool _windows;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -99,6 +100,18 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the server has been started.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// <c>true</c> if the server has been started; otherwise, <c>false</c>.
|
||||||
|
/// </value>
|
||||||
|
public bool IsListening {
|
||||||
|
get {
|
||||||
|
return _listening;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the port on which to listen for incoming requests.
|
/// Gets the port on which to listen for incoming requests.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -125,7 +138,8 @@ namespace WebSocketSharp.Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set {
|
set {
|
||||||
_rootPath = value;
|
if (!_listening)
|
||||||
|
_rootPath = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,18 +234,18 @@ namespace WebSocketSharp.Server {
|
|||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
_listener = new HttpListener();
|
_listener = new HttpListener();
|
||||||
|
_listening = false;
|
||||||
|
_rootPath = getRootPath();
|
||||||
_svcHosts = new ServiceHostManager();
|
_svcHosts = new ServiceHostManager();
|
||||||
|
|
||||||
_isWindows = false;
|
_windows = false;
|
||||||
var os = Environment.OSVersion;
|
var os = Environment.OSVersion;
|
||||||
if (os.Platform != PlatformID.Unix && os.Platform != PlatformID.MacOSX)
|
if (os.Platform != PlatformID.Unix && os.Platform != PlatformID.MacOSX)
|
||||||
_isWindows = true;
|
_windows = true;
|
||||||
|
|
||||||
var prefix = String.Format(
|
var prefix = String.Format(
|
||||||
"http{0}://*:{1}/", _port == 443 ? "s" : String.Empty, _port);
|
"http{0}://*:{1}/", _port == 443 ? "s" : String.Empty, _port);
|
||||||
_listener.Prefixes.Add(prefix);
|
_listener.Prefixes.Add(prefix);
|
||||||
|
|
||||||
_rootPath = getRootPath();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string getRootPath()
|
private static string getRootPath()
|
||||||
@ -252,7 +266,7 @@ namespace WebSocketSharp.Server {
|
|||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
var callerFrame = new StackFrame(1);
|
var callerFrame = new StackFrame(1);
|
||||||
var caller = callerFrame.GetMethod();
|
var caller = callerFrame.GetMethod();
|
||||||
Console.WriteLine("HTTPSV: Error@{0}: {1}", caller.Name, message);
|
Console.WriteLine("HTTPSV: Error@{0}: {1}", caller.Name, message);
|
||||||
#endif
|
#endif
|
||||||
OnError.Emit(this, new ErrorEventArgs(message));
|
OnError.Emit(this, new ErrorEventArgs(message));
|
||||||
@ -382,9 +396,9 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
private bool upgradeToWebSocket(HttpListenerContext context)
|
private bool upgradeToWebSocket(HttpListenerContext context)
|
||||||
{
|
{
|
||||||
var res = context.Response;
|
var res = context.Response;
|
||||||
var wsContext = context.AcceptWebSocket();
|
var wsContext = context.AcceptWebSocket();
|
||||||
var path = wsContext.Path.UrlDecode();
|
var path = wsContext.Path.UrlDecode();
|
||||||
|
|
||||||
IServiceHost svcHost;
|
IServiceHost svcHost;
|
||||||
if (!_svcHosts.TryGetServiceHost(path, out svcHost))
|
if (!_svcHosts.TryGetServiceHost(path, out svcHost))
|
||||||
@ -441,7 +455,7 @@ namespace WebSocketSharp.Server {
|
|||||||
public byte[] GetFile(string path)
|
public byte[] GetFile(string path)
|
||||||
{
|
{
|
||||||
var filePath = _rootPath + path;
|
var filePath = _rootPath + path;
|
||||||
if (_isWindows)
|
if (_windows)
|
||||||
filePath = filePath.Replace("/", "\\");
|
filePath = filePath.Replace("/", "\\");
|
||||||
|
|
||||||
return File.Exists(filePath)
|
return File.Exists(filePath)
|
||||||
@ -450,22 +464,30 @@ namespace WebSocketSharp.Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Starts the <see cref="HttpServer"/>.
|
/// Starts to receive the HTTP requests.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
|
if (_listening)
|
||||||
|
return;
|
||||||
|
|
||||||
_listener.Start();
|
_listener.Start();
|
||||||
startReceiveRequestThread();
|
startReceiveRequestThread();
|
||||||
|
_listening = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shuts down the <see cref="HttpServer"/>.
|
/// Stops receiving the HTTP requests.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
|
if (!_listening)
|
||||||
|
return;
|
||||||
|
|
||||||
_listener.Close();
|
_listener.Close();
|
||||||
_receiveRequestThread.Join(5 * 1000);
|
_receiveRequestThread.Join(5 * 1000);
|
||||||
_svcHosts.Stop();
|
_svcHosts.Stop();
|
||||||
|
_listening = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -88,7 +88,7 @@ namespace WebSocketSharp.Server {
|
|||||||
throw new ArgumentException(msg, "url");
|
throw new ArgumentException(msg, "url");
|
||||||
}
|
}
|
||||||
|
|
||||||
init();
|
_svcHosts = new ServiceHostManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -137,7 +137,7 @@ namespace WebSocketSharp.Server {
|
|||||||
public WebSocketServer(System.Net.IPAddress address, int port, bool secure)
|
public WebSocketServer(System.Net.IPAddress address, int port, bool secure)
|
||||||
: base(address, port, "/", secure)
|
: base(address, port, "/", secure)
|
||||||
{
|
{
|
||||||
init();
|
_svcHosts = new ServiceHostManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -155,6 +155,7 @@ namespace WebSocketSharp.Server {
|
|||||||
var url = BaseUri.IsAbsoluteUri
|
var url = BaseUri.IsAbsoluteUri
|
||||||
? BaseUri.ToString().TrimEnd('/')
|
? BaseUri.ToString().TrimEnd('/')
|
||||||
: String.Empty;
|
: String.Empty;
|
||||||
|
|
||||||
foreach (var path in _svcHosts.Paths)
|
foreach (var path in _svcHosts.Paths)
|
||||||
yield return url + path;
|
yield return url + path;
|
||||||
}
|
}
|
||||||
@ -180,15 +181,6 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
_svcHosts = new ServiceHostManager();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -199,18 +191,18 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </param>
|
/// </param>
|
||||||
protected override void AcceptWebSocket(TcpListenerWebSocketContext context)
|
protected override void AcceptWebSocket(TcpListenerWebSocketContext context)
|
||||||
{
|
{
|
||||||
var websocket = context.WebSocket;
|
var ws = context.WebSocket;
|
||||||
var path = context.Path.UrlDecode();
|
var path = context.Path.UrlDecode();
|
||||||
|
|
||||||
IServiceHost svcHost;
|
IServiceHost svcHost;
|
||||||
if (!_svcHosts.TryGetServiceHost(path, out svcHost))
|
if (!_svcHosts.TryGetServiceHost(path, out svcHost))
|
||||||
{
|
{
|
||||||
websocket.Close(HttpStatusCode.NotImplemented);
|
ws.Close(HttpStatusCode.NotImplemented);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BaseUri.IsAbsoluteUri)
|
if (BaseUri.IsAbsoluteUri)
|
||||||
websocket.Url = new Uri(BaseUri, path);
|
ws.Url = new Uri(BaseUri, path);
|
||||||
|
|
||||||
svcHost.BindWebSocket(context);
|
svcHost.BindWebSocket(context);
|
||||||
}
|
}
|
||||||
@ -242,6 +234,7 @@ namespace WebSocketSharp.Server {
|
|||||||
svcHost.Uri = BaseUri.IsAbsoluteUri
|
svcHost.Uri = BaseUri.IsAbsoluteUri
|
||||||
? new Uri(BaseUri, absPath)
|
? new Uri(BaseUri, absPath)
|
||||||
: absPath.ToUri();
|
: absPath.ToUri();
|
||||||
|
|
||||||
if (!Sweeping)
|
if (!Sweeping)
|
||||||
svcHost.Sweeping = false;
|
svcHost.Sweeping = false;
|
||||||
|
|
||||||
|
@ -45,11 +45,12 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private Thread _receiveRequestThread;
|
|
||||||
private IPAddress _address;
|
private IPAddress _address;
|
||||||
private bool _isSecure;
|
private bool _listening;
|
||||||
private bool _isSelfHost;
|
|
||||||
private int _port;
|
private int _port;
|
||||||
|
private Thread _receiveRequestThread;
|
||||||
|
private bool _secure;
|
||||||
|
private bool _selfHost;
|
||||||
private TcpListener _tcpListener;
|
private TcpListener _tcpListener;
|
||||||
private Uri _uri;
|
private Uri _uri;
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected WebSocketServerBase()
|
protected WebSocketServerBase()
|
||||||
{
|
{
|
||||||
_isSelfHost = false;
|
_selfHost = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -133,7 +134,7 @@ namespace WebSocketSharp.Server {
|
|||||||
if (!absPath.IsValidAbsolutePath(out msg))
|
if (!absPath.IsValidAbsolutePath(out msg))
|
||||||
throw new ArgumentException(msg, "absPath");
|
throw new ArgumentException(msg, "absPath");
|
||||||
|
|
||||||
if ((port == 80 && secure) ||
|
if ((port == 80 && secure) ||
|
||||||
(port == 443 && !secure))
|
(port == 443 && !secure))
|
||||||
{
|
{
|
||||||
msg = String.Format(
|
msg = String.Format(
|
||||||
@ -141,12 +142,10 @@ namespace WebSocketSharp.Server {
|
|||||||
throw new ArgumentException(msg);
|
throw new ArgumentException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
_address = address;
|
_address = address;
|
||||||
_port = port > 0
|
_port = port > 0 ? port : secure ? 443 : 80;
|
||||||
? port
|
_uri = absPath.ToUri();
|
||||||
: secure ? 443 : 80;
|
_secure = secure;
|
||||||
_uri = absPath.ToUri();
|
|
||||||
_isSecure = secure;
|
|
||||||
|
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
@ -161,8 +160,7 @@ namespace WebSocketSharp.Server {
|
|||||||
/// <value>
|
/// <value>
|
||||||
/// A <see cref="Uri"/> that contains a WebSocket URL.
|
/// A <see cref="Uri"/> that contains a WebSocket URL.
|
||||||
/// </value>
|
/// </value>
|
||||||
protected Uri BaseUri
|
protected Uri BaseUri {
|
||||||
{
|
|
||||||
get {
|
get {
|
||||||
return _uri;
|
return _uri;
|
||||||
}
|
}
|
||||||
@ -188,6 +186,18 @@ namespace WebSocketSharp.Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the server has been started.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// <c>true</c> if the server has been started; otherwise, <c>false</c>.
|
||||||
|
/// </value>
|
||||||
|
public bool IsListening {
|
||||||
|
get {
|
||||||
|
return _listening;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the server provides secure connection.
|
/// Gets a value indicating whether the server provides secure connection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -196,7 +206,7 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </value>
|
/// </value>
|
||||||
public bool IsSecure {
|
public bool IsSecure {
|
||||||
get {
|
get {
|
||||||
return _isSecure;
|
return _secure;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +218,7 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </value>
|
/// </value>
|
||||||
public bool IsSelfHost {
|
public bool IsSelfHost {
|
||||||
get {
|
get {
|
||||||
return _isSelfHost;
|
return _selfHost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +247,38 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
private void acceptWebSocketAsync(TcpListenerWebSocketContext context)
|
private void init()
|
||||||
|
{
|
||||||
|
_listening = false;
|
||||||
|
_selfHost = true;
|
||||||
|
_tcpListener = new TcpListener(_address, _port);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(Uri uri)
|
||||||
|
{
|
||||||
|
var scheme = uri.Scheme;
|
||||||
|
var host = uri.DnsSafeHost;
|
||||||
|
var port = uri.Port;
|
||||||
|
var addrs = Dns.GetHostAddresses(host);
|
||||||
|
|
||||||
|
_uri = uri;
|
||||||
|
_address = addrs[0];
|
||||||
|
_secure = scheme == "wss" ? true : false;
|
||||||
|
_port = port > 0 ? port : _secure ? 443 : 80;
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onError(string message)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
var callerFrame = new StackFrame(1);
|
||||||
|
var caller = callerFrame.GetMethod();
|
||||||
|
Console.WriteLine("WSSV: Error@{0}: {1}", caller.Name, message);
|
||||||
|
#endif
|
||||||
|
OnError.Emit(this, new ErrorEventArgs(message));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processRequestAsync(TcpListenerWebSocketContext context)
|
||||||
{
|
{
|
||||||
WaitCallback callback = (state) =>
|
WaitCallback callback = (state) =>
|
||||||
{
|
{
|
||||||
@ -254,47 +295,14 @@ namespace WebSocketSharp.Server {
|
|||||||
ThreadPool.QueueUserWorkItem(callback);
|
ThreadPool.QueueUserWorkItem(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
_tcpListener = new TcpListener(_address, _port);
|
|
||||||
_isSelfHost = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init(Uri uri)
|
|
||||||
{
|
|
||||||
var scheme = uri.Scheme;
|
|
||||||
var host = uri.DnsSafeHost;
|
|
||||||
var port = uri.Port;
|
|
||||||
var addrs = Dns.GetHostAddresses(host);
|
|
||||||
|
|
||||||
_uri = uri;
|
|
||||||
_address = addrs[0];
|
|
||||||
_isSecure = scheme == "wss" ? true : false;
|
|
||||||
_port = port > 0
|
|
||||||
? port
|
|
||||||
: _isSecure ? 443 : 80;
|
|
||||||
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onError(string message)
|
|
||||||
{
|
|
||||||
#if DEBUG
|
|
||||||
var callerFrame = new StackFrame(1);
|
|
||||||
var caller = callerFrame.GetMethod();
|
|
||||||
Console.WriteLine("WSSV: Error@{0}: {1}", caller.Name, message);
|
|
||||||
#endif
|
|
||||||
OnError.Emit(this, new ErrorEventArgs(message));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void receiveRequest()
|
private void receiveRequest()
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var context = _tcpListener.AcceptWebSocket(_isSecure);
|
var context = _tcpListener.AcceptWebSocket(_secure);
|
||||||
acceptWebSocketAsync(context);
|
processRequestAsync(context);
|
||||||
}
|
}
|
||||||
catch (SocketException)
|
catch (SocketException)
|
||||||
{
|
{
|
||||||
@ -323,8 +331,9 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
if (!result.Query.IsNullOrEmpty())
|
if (!result.Query.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
result = null;
|
result = null;
|
||||||
message = "Must not contain the query component: " + uriString;
|
message = "Must not contain the query component: " + uriString;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,11 +372,12 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Start()
|
public virtual void Start()
|
||||||
{
|
{
|
||||||
if (!_isSelfHost)
|
if (!_selfHost || _listening)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_tcpListener.Start();
|
_tcpListener.Start();
|
||||||
startReceiveRequestThread();
|
startReceiveRequestThread();
|
||||||
|
_listening = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -375,11 +385,12 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Stop()
|
public virtual void Stop()
|
||||||
{
|
{
|
||||||
if (!_isSelfHost)
|
if (!_selfHost || !_listening)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_tcpListener.Stop();
|
_tcpListener.Stop();
|
||||||
_receiveRequestThread.Join(5 * 1000);
|
_receiveRequestThread.Join(5 * 1000);
|
||||||
|
_listening = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -58,7 +58,7 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
internal WebSocketServiceHost()
|
internal WebSocketServiceHost()
|
||||||
{
|
{
|
||||||
init();
|
_sessions = new WebSocketServiceManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -87,7 +87,7 @@ namespace WebSocketSharp.Server {
|
|||||||
public WebSocketServiceHost(string url)
|
public WebSocketServiceHost(string url)
|
||||||
: base(url)
|
: base(url)
|
||||||
{
|
{
|
||||||
init();
|
_sessions = new WebSocketServiceManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -175,7 +175,7 @@ namespace WebSocketSharp.Server {
|
|||||||
public WebSocketServiceHost(System.Net.IPAddress address, int port, string absPath, bool secure)
|
public WebSocketServiceHost(System.Net.IPAddress address, int port, string absPath, bool secure)
|
||||||
: base(address, port, absPath, secure)
|
: base(address, port, absPath, secure)
|
||||||
{
|
{
|
||||||
init();
|
_sessions = new WebSocketServiceManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -218,15 +218,6 @@ namespace WebSocketSharp.Server {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
|
||||||
|
|
||||||
private void init()
|
|
||||||
{
|
|
||||||
_sessions = new WebSocketServiceManager();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -237,16 +228,16 @@ namespace WebSocketSharp.Server {
|
|||||||
/// </param>
|
/// </param>
|
||||||
protected override void AcceptWebSocket(TcpListenerWebSocketContext context)
|
protected override void AcceptWebSocket(TcpListenerWebSocketContext context)
|
||||||
{
|
{
|
||||||
var websocket = context.WebSocket;
|
var ws = context.WebSocket;
|
||||||
var path = context.Path.UrlDecode();
|
var path = context.Path.UrlDecode();
|
||||||
if (path != Uri.GetAbsolutePath().UrlDecode())
|
if (path != Uri.GetAbsolutePath().UrlDecode())
|
||||||
{
|
{
|
||||||
websocket.Close(HttpStatusCode.NotImplemented);
|
ws.Close(HttpStatusCode.NotImplemented);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Uri.IsAbsoluteUri)
|
if (Uri.IsAbsoluteUri)
|
||||||
websocket.Url = Uri;
|
ws.Url = Uri;
|
||||||
|
|
||||||
((IServiceHost)this).BindWebSocket(context);
|
((IServiceHost)this).BindWebSocket(context);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user