Skip to content

Commit b187168

Browse files
add mono check
1 parent 7700f00 commit b187168

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

MediaBrowser.Server.Implementations/HttpServer/NetListener/HttpListenerServer.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class HttpListenerServer : IHttpListener
2424
public Func<IHttpRequest, Uri, Task> RequestHandler { get; set; }
2525

2626
private readonly Action<string> _endpointListener;
27-
27+
2828
public HttpListenerServer(ILogger logger, Action<string> endpointListener)
2929
{
3030
_logger = logger;
@@ -84,7 +84,7 @@ private void Listen()
8484
private void ListenerCallback(IAsyncResult asyncResult)
8585
{
8686
_listenForNextRequest.Set();
87-
87+
8888
var listener = asyncResult.AsyncState as HttpListener;
8989
HttpListenerContext context;
9090

@@ -161,6 +161,7 @@ private Task ProcessRequestAsync(HttpListenerContext context)
161161
/// <returns>Task.</returns>
162162
private async Task ProcessWebSocketRequest(HttpListenerContext ctx)
163163
{
164+
#if !__MonoCS__
164165
try
165166
{
166167
var webSocketContext = await ctx.AcceptWebSocketAsync(null).ConfigureAwait(false);
@@ -180,13 +181,14 @@ private async Task ProcessWebSocketRequest(HttpListenerContext ctx)
180181
ctx.Response.StatusCode = 500;
181182
ctx.Response.Close();
182183
}
184+
#endif
183185
}
184186

185187
private void HandleError(Exception ex, HttpListenerContext context)
186188
{
187189
var operationName = context.Request.GetOperationName();
188190
var httpReq = GetRequest(context, operationName);
189-
191+
190192
if (ErrorHandler != null)
191193
{
192194
ErrorHandler(ex, httpReq);
@@ -280,4 +282,4 @@ protected virtual void Dispose(bool disposing)
280282
}
281283
}
282284
}
283-
}
285+
}

0 commit comments

Comments
 (0)