[Modify] Rename it

This commit is contained in:
sta 2016-06-28 16:52:17 +09:00
parent 2a6e25a76f
commit 5af4a39539

View File

@ -164,22 +164,6 @@ namespace WebSocketSharp.Net
prefixes.Add (prefix); prefixes.Add (prefix);
} }
private void checkIfRemove ()
{
if (_prefixes.Count > 0)
return;
var prefs = _unhandled;
if (prefs != null && prefs.Count > 0)
return;
prefs = _all;
if (prefs != null && prefs.Count > 0)
return;
EndPointManager.RemoveEndPoint (_endpoint);
}
private static RSACryptoServiceProvider createRSAFromFile (string filename) private static RSACryptoServiceProvider createRSAFromFile (string filename)
{ {
byte[] pvk = null; byte[] pvk = null;
@ -217,6 +201,22 @@ namespace WebSocketSharp.Net
return defaultCertificate; return defaultCertificate;
} }
private void leaveIfNoPrefix ()
{
if (_prefixes.Count > 0)
return;
var prefs = _unhandled;
if (prefs != null && prefs.Count > 0)
return;
prefs = _all;
if (prefs != null && prefs.Count > 0)
return;
EndPointManager.RemoveEndPoint (_endpoint);
}
private static void onAccept (IAsyncResult asyncResult) private static void onAccept (IAsyncResult asyncResult)
{ {
var lsnr = (EndPointListener) asyncResult.AsyncState; var lsnr = (EndPointListener) asyncResult.AsyncState;
@ -476,7 +476,7 @@ namespace WebSocketSharp.Net
} }
while (Interlocked.CompareExchange (ref _unhandled, future, current) != current); while (Interlocked.CompareExchange (ref _unhandled, future, current) != current);
checkIfRemove (); leaveIfNoPrefix ();
return; return;
} }
@ -492,7 +492,7 @@ namespace WebSocketSharp.Net
} }
while (Interlocked.CompareExchange (ref _all, future, current) != current); while (Interlocked.CompareExchange (ref _all, future, current) != current);
checkIfRemove (); leaveIfNoPrefix ();
return; return;
} }
@ -507,7 +507,7 @@ namespace WebSocketSharp.Net
} }
while (Interlocked.CompareExchange (ref _prefixes, prefs2, prefs) != prefs); while (Interlocked.CompareExchange (ref _prefixes, prefs2, prefs) != prefs);
checkIfRemove (); leaveIfNoPrefix ();
} }
#endregion #endregion