aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-08-31 15:15:33 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-08-31 15:15:33 -0400
commit45db7d21b2a0a18b73253c64651a57c60880b084 (patch)
tree3f6eb8bae23c5c7a3cab6e4c4ee34f8b2ba1838f /MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs
parent10dedf92adddeae707bae5a4204c8164f5bfea48 (diff)
localize plugin installation process
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs13
1 files changed, 4 insertions, 9 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs b/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs
index 477aa3878..f2fae9e90 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs
@@ -3,7 +3,6 @@ using MediaBrowser.Model.Logging;
using ServiceStack;
using ServiceStack.Web;
using System;
-using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -15,20 +14,16 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
{
public class WebSocketSharpListener : IHttpListener
{
- private readonly ConcurrentDictionary<string, string> _localEndPoints = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase);
private WebSocketSharp.Net.HttpListener _listener;
private readonly AutoResetEvent _listenForNextRequest = new AutoResetEvent(false);
private readonly ILogger _logger;
+ private readonly Action<string> _endpointListener;
- public WebSocketSharpListener(ILogger logger)
+ public WebSocketSharpListener(ILogger logger, Action<string> endpointListener)
{
_logger = logger;
- }
-
- public IEnumerable<string> LocalEndPoints
- {
- get { return _localEndPoints.Keys.ToList(); }
+ _endpointListener = endpointListener;
}
public Action<Exception, IRequest> ErrorHandler { get; set; }
@@ -170,7 +165,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
{
var address = endpoint.ToString();
- _localEndPoints.GetOrAdd(address, address);
+ _endpointListener(address);
}
LogRequest(_logger, request);