Making BlockHeadClient timeouts more sane
This commit is contained in:
parent
d3b599d67c
commit
0d1fee5906
|
@ -44,8 +44,6 @@ public class WebSocketServletRFCTest
|
|||
public void registerWebSockets(WebSocketServerFactory factory)
|
||||
{
|
||||
factory.register(RFCSocket.class);
|
||||
|
||||
factory.getPolicy().setMaxIdleTime(800);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -221,12 +221,13 @@ public class BlockheadClient implements Parser.Listener
|
|||
int startCount = incomingFrameQueue.size();
|
||||
|
||||
ByteBuffer buf = bufferPool.acquire(policy.getBufferSize(),false);
|
||||
BufferUtil.clear(buf);
|
||||
BufferUtil.clearToFill(buf);
|
||||
try
|
||||
{
|
||||
long msDur = TimeUnit.MILLISECONDS.convert(timeoutDuration,timeoutUnit);
|
||||
long now = System.currentTimeMillis();
|
||||
long expireOn = now + TimeUnit.MILLISECONDS.convert(timeoutDuration,timeoutUnit);
|
||||
LOG.debug("Now: {} - expireOn: {}",now,expireOn);
|
||||
long expireOn = now + msDur;
|
||||
LOG.debug("Now: {} - expireOn: {} ({} ms)",now,expireOn,msDur);
|
||||
|
||||
int len = 0;
|
||||
while (incomingFrameQueue.size() < (startCount + expectedCount))
|
||||
|
|
Loading…
Reference in New Issue