diff --git a/MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs b/MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs index 4ea0a65f03..2d41cc26f2 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs @@ -24,7 +24,7 @@ public class HttpListenerServer : IHttpListener public Func RequestHandler { get; set; } private readonly Action _endpointListener; - + public HttpListenerServer(ILogger logger, Action endpointListener) { _logger = logger; @@ -84,7 +84,7 @@ private void Listen() private void ListenerCallback(IAsyncResult asyncResult) { _listenForNextRequest.Set(); - + var listener = asyncResult.AsyncState as HttpListener; HttpListenerContext context; @@ -161,6 +161,7 @@ private Task ProcessRequestAsync(HttpListenerContext context) /// Task. private async Task ProcessWebSocketRequest(HttpListenerContext ctx) { +#if !__MonoCS__ try { var webSocketContext = await ctx.AcceptWebSocketAsync(null).ConfigureAwait(false); @@ -180,13 +181,14 @@ private async Task ProcessWebSocketRequest(HttpListenerContext ctx) 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 @@ protected virtual void Dispose(bool disposing) } } } -} +} \ No newline at end of file