diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-08 19:31:54 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-08 19:31:54 -0400 |
| commit | ad6f47329f6600a42868c58056656ea8f65d2ca6 (patch) | |
| tree | 187d2c451401857193673a042e46643ebb5d3572 /MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs | |
| parent | d091fe0e6e5923bd0ce597c83d9a76650e3dc7f9 (diff) | |
add mono check
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs b/MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs index 4ea0a65f0..2d41cc26f 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs @@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.NetListener public Func<IHttpRequest, Uri, Task> RequestHandler { get; set; } private readonly Action<string> _endpointListener; - + public HttpListenerServer(ILogger logger, Action<string> endpointListener) { _logger = logger; @@ -84,7 +84,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.NetListener private void ListenerCallback(IAsyncResult asyncResult) { _listenForNextRequest.Set(); - + var listener = asyncResult.AsyncState as HttpListener; HttpListenerContext context; @@ -161,6 +161,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.NetListener /// <returns>Task.</returns> private async Task ProcessWebSocketRequest(HttpListenerContext ctx) { +#if !__MonoCS__ try { var webSocketContext = await ctx.AcceptWebSocketAsync(null).ConfigureAwait(false); @@ -180,13 +181,14 @@ namespace MediaBrowser.Server.Implementations.HttpServer.NetListener ctx.Response.StatusCode = 500; ctx.Response.Close(); } +#endif } private void HandleError(Exception ex, HttpListenerContext context) { var operationName = context.Request.GetOperationName(); var httpReq = GetRequest(context, operationName); - + if (ErrorHandler != null) { ErrorHandler(ex, httpReq); @@ -280,4 +282,4 @@ namespace MediaBrowser.Server.Implementations.HttpServer.NetListener } } } -} +}
\ No newline at end of file |
