aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-04 16:08:45 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-04 16:08:45 -0400
commit54a5d63a619eeb78b4e84c626a4c208419be9705 (patch)
tree912f682b59e352ba42245ede2c3c2e6f2fddc61d /MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
parentb40991b28de1312bbd16855c30aa371921014787 (diff)
mono fixes
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs38
1 files changed, 22 insertions, 16 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
index 2ef9bed9f..5f354fb0d 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
@@ -382,22 +382,23 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <returns>Task.</returns>
private async Task ProcessWebSocketRequest(HttpListenerContext ctx)
{
+ #if __MonoCS__
+ #else
try
- {
- var webSocketContext = await ctx.AcceptWebSocketAsync(null).ConfigureAwait(false);
-
- if (WebSocketConnected != null)
- {
- WebSocketConnected(this, new WebSocketConnectEventArgs { WebSocket = new NativeWebSocket(webSocketContext.WebSocket, _logger), Endpoint = ctx.Request.RemoteEndPoint.ToString() });
- }
- }
- catch (Exception ex)
- {
- _logger.ErrorException("AcceptWebSocketAsync error", ex);
-
- ctx.Response.StatusCode = 500;
- ctx.Response.Close();
- }
+ {
+ var webSocketContext = await ctx.AcceptWebSocketAsync(null).ConfigureAwait(false);
+ if (WebSocketConnected != null)
+ {
+ WebSocketConnected(this, new WebSocketConnectEventArgs { WebSocket = new NativeWebSocket(webSocketContext.WebSocket, _logger), Endpoint = ctx.Request.RemoteEndPoint.ToString() });
+ }
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("AcceptWebSocketAsync error", ex);
+ ctx.Response.StatusCode = 500;
+ ctx.Response.Close();
+ }
+ #endif
}
/// <summary>
@@ -532,7 +533,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer
{
get
{
- if (!_supportsNativeWebSocket.HasValue)
+ #if __MonoCS__
+ return false;
+ #else
+ #endif
+
+ if (!_supportsNativeWebSocket.HasValue)
{
try
{