[Modify] Rename it
This commit is contained in:
@@ -68,8 +68,8 @@ namespace WebSocketSharp.Net
|
|||||||
private object _connectionsSync;
|
private object _connectionsSync;
|
||||||
private List<HttpListenerContext> _ctxQueue;
|
private List<HttpListenerContext> _ctxQueue;
|
||||||
private object _ctxQueueSync;
|
private object _ctxQueueSync;
|
||||||
private Dictionary<HttpListenerContext, HttpListenerContext> _ctxRegistry;
|
private Dictionary<HttpListenerContext, HttpListenerContext> _contextRegistry;
|
||||||
private object _ctxRegistrySync;
|
private object _contextRegistrySync;
|
||||||
private static readonly string _defaultRealm;
|
private static readonly string _defaultRealm;
|
||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
private bool _ignoreWriteExceptions;
|
private bool _ignoreWriteExceptions;
|
||||||
@@ -109,8 +109,8 @@ namespace WebSocketSharp.Net
|
|||||||
_ctxQueue = new List<HttpListenerContext> ();
|
_ctxQueue = new List<HttpListenerContext> ();
|
||||||
_ctxQueueSync = ((ICollection) _ctxQueue).SyncRoot;
|
_ctxQueueSync = ((ICollection) _ctxQueue).SyncRoot;
|
||||||
|
|
||||||
_ctxRegistry = new Dictionary<HttpListenerContext, HttpListenerContext> ();
|
_contextRegistry = new Dictionary<HttpListenerContext, HttpListenerContext> ();
|
||||||
_ctxRegistrySync = ((ICollection) _ctxRegistry).SyncRoot;
|
_contextRegistrySync = ((ICollection) _contextRegistry).SyncRoot;
|
||||||
|
|
||||||
_logger = new Logger ();
|
_logger = new Logger ();
|
||||||
|
|
||||||
@@ -463,16 +463,16 @@ namespace WebSocketSharp.Net
|
|||||||
{
|
{
|
||||||
HttpListenerContext[] ctxs = null;
|
HttpListenerContext[] ctxs = null;
|
||||||
|
|
||||||
lock (_ctxRegistrySync) {
|
lock (_contextRegistrySync) {
|
||||||
if (_ctxRegistry.Count == 0)
|
if (_contextRegistry.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Need to copy this since closing will call the UnregisterContext method.
|
// Need to copy this since closing will call the UnregisterContext method.
|
||||||
var keys = _ctxRegistry.Keys;
|
var keys = _contextRegistry.Keys;
|
||||||
ctxs = new HttpListenerContext[keys.Count];
|
ctxs = new HttpListenerContext[keys.Count];
|
||||||
keys.CopyTo (ctxs, 0);
|
keys.CopyTo (ctxs, 0);
|
||||||
|
|
||||||
_ctxRegistry.Clear ();
|
_contextRegistry.Clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = ctxs.Length - 1; i >= 0; i--)
|
for (var i = ctxs.Length - 1; i >= 0; i--)
|
||||||
@@ -504,7 +504,7 @@ namespace WebSocketSharp.Net
|
|||||||
EndPointManager.RemoveListener (this);
|
EndPointManager.RemoveListener (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (_ctxRegistrySync)
|
lock (_contextRegistrySync)
|
||||||
cleanupContextQueue (!force);
|
cleanupContextQueue (!force);
|
||||||
|
|
||||||
cleanupContextRegistry ();
|
cleanupContextRegistry ();
|
||||||
@@ -563,7 +563,7 @@ namespace WebSocketSharp.Net
|
|||||||
HttpListenerAsyncResult asyncResult
|
HttpListenerAsyncResult asyncResult
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
lock (_ctxRegistrySync) {
|
lock (_contextRegistrySync) {
|
||||||
if (!_listening)
|
if (!_listening)
|
||||||
throw new HttpListenerException (995);
|
throw new HttpListenerException (995);
|
||||||
|
|
||||||
@@ -601,11 +601,11 @@ namespace WebSocketSharp.Net
|
|||||||
if (!_listening)
|
if (!_listening)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lock (_ctxRegistrySync) {
|
lock (_contextRegistrySync) {
|
||||||
if (!_listening)
|
if (!_listening)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_ctxRegistry[context] = context;
|
_contextRegistry[context] = context;
|
||||||
|
|
||||||
var ares = getAsyncResultFromQueue ();
|
var ares = getAsyncResultFromQueue ();
|
||||||
|
|
||||||
@@ -643,8 +643,8 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
internal void UnregisterContext (HttpListenerContext context)
|
internal void UnregisterContext (HttpListenerContext context)
|
||||||
{
|
{
|
||||||
lock (_ctxRegistrySync)
|
lock (_contextRegistrySync)
|
||||||
_ctxRegistry.Remove (context);
|
_contextRegistry.Remove (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -868,7 +868,7 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
EndPointManager.RemoveListener (this);
|
EndPointManager.RemoveListener (this);
|
||||||
|
|
||||||
lock (_ctxRegistrySync)
|
lock (_contextRegistrySync)
|
||||||
cleanupContextQueue (true);
|
cleanupContextQueue (true);
|
||||||
|
|
||||||
cleanupContextRegistry ();
|
cleanupContextRegistry ();
|
||||||
|
Reference in New Issue
Block a user