update web socket sharp

This commit is contained in:
Luke Pulverenti
2014-09-14 20:39:24 -04:00
parent 5f87d57381
commit 5abbc84122
2 changed files with 10 additions and 8 deletions

View File

@@ -78,6 +78,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
// Handle the processing of a request in here.
private void ListenerCallback(IAsyncResult asyncResult)
{
_listenForNextRequest.Set();
var listener = asyncResult.AsyncState as HttpListener;
HttpListenerContext context;
@@ -88,8 +90,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
{
if (!isListening)
{
_logger.Debug("Ignoring ListenerCallback() as HttpListener is no longer listening");
return;
_logger.Debug("Ignoring ListenerCallback() as HttpListener is no longer listening"); return;
}
// The EndGetContext() method, as with all Begin/End asynchronous methods in the .NET Framework,
// blocks until there is a request to be processed or some type of data is available.
@@ -105,10 +106,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
_logger.Warn(errMsg);
return;
}
finally
{
_listenForNextRequest.Set();
}
Task.Factory.StartNew(() => InitTask(context));
}
@@ -268,4 +265,4 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
}
}
}
}
}