[Modify] Use it instead
This commit is contained in:
parent
2e2c7d34c8
commit
e61d5bc67f
@ -60,6 +60,7 @@ namespace WebSocketSharp.Net
|
|||||||
{
|
{
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
|
private int _attempts;
|
||||||
private byte[] _buffer;
|
private byte[] _buffer;
|
||||||
private static readonly int _bufferLength;
|
private static readonly int _bufferLength;
|
||||||
private HttpListenerContext _context;
|
private HttpListenerContext _context;
|
||||||
@ -268,7 +269,7 @@ namespace WebSocketSharp.Net
|
|||||||
private static void onRead (IAsyncResult asyncResult)
|
private static void onRead (IAsyncResult asyncResult)
|
||||||
{
|
{
|
||||||
var conn = (HttpConnection) asyncResult.AsyncState;
|
var conn = (HttpConnection) asyncResult.AsyncState;
|
||||||
var current = conn._reuses;
|
var current = conn._attempts;
|
||||||
|
|
||||||
if (conn._socket == null)
|
if (conn._socket == null)
|
||||||
return;
|
return;
|
||||||
@ -351,7 +352,7 @@ namespace WebSocketSharp.Net
|
|||||||
private static void onTimeout (object state)
|
private static void onTimeout (object state)
|
||||||
{
|
{
|
||||||
var conn = (HttpConnection) state;
|
var conn = (HttpConnection) state;
|
||||||
var current = conn._reuses;
|
var current = conn._attempts;
|
||||||
|
|
||||||
if (conn._socket == null)
|
if (conn._socket == null)
|
||||||
return;
|
return;
|
||||||
@ -464,7 +465,9 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
internal void BeginReadRequest ()
|
internal void BeginReadRequest ()
|
||||||
{
|
{
|
||||||
_timeoutCanceled.Add (_reuses, false);
|
_attempts++;
|
||||||
|
|
||||||
|
_timeoutCanceled.Add (_attempts, false);
|
||||||
_timer.Change (_timeout, Timeout.Infinite);
|
_timer.Change (_timeout, Timeout.Infinite);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user