diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-03 03:28:58 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-03 03:28:58 -0400 |
| commit | 2084678266e7e65dde077fc2caee63c0051bf3db (patch) | |
| tree | d6f6b236ac4da21746a9f3d7ce0cbe8b33761434 /Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs | |
| parent | e0c1d740a3b83775fa1f2f2c3ba1fd985e83d98b (diff) | |
update service creation
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs index e71b99e8c..10aaa4032 100644 --- a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs +++ b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs @@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp } public Action<Exception, IRequest, bool> ErrorHandler { get; set; } - public Func<IHttpRequest, Uri, CancellationToken, Task> RequestHandler { get; set; } + public Func<IHttpRequest, string, string, string, CancellationToken, Task> RequestHandler { get; set; } public Action<WebSocketConnectingEventArgs> WebSocketConnecting { get; set; } @@ -114,7 +114,9 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp return Task.FromResult(true); } - return RequestHandler(httpReq, request.Url, cancellationToken); + var uri = request.Url; + + return RequestHandler(httpReq, uri.OriginalString, uri.Host, uri.LocalPath, cancellationToken); } private void ProcessWebSocketRequest(HttpListenerContext ctx) @@ -177,7 +179,7 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp return req; } - public void Stop() + public Task Stop() { _disposeCancellationTokenSource.Cancel(); @@ -190,6 +192,8 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp _listener.Close(); } + + return Task.FromResult(true); } public void Dispose() |
