if ( selector != null ) pool.put(selector);
}
if ( block ) bytebuffer.clear(); //only clear
- this.total = 0;
return written;
}
}
- private int total = 0;
private synchronized void addToBB(byte[] buf, int offset, int length) throws IOException {
while (length > 0) {
int thisTime = length;
socket.getBufHandler().getWriteBuffer().put(buf, offset, thisTime);
length = length - thisTime;
offset = offset + thisTime;
- total += thisTime;
}
NioEndpoint.KeyAttachment ka = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
if ( ka!= null ) ka.access();//prevent timeouts for just doing client writes