}
private void sendBuffers () throws IOException {
boolean needMore1 = sendBuffer (fromBuffer, to, toLogger);
if (needMore1) {
HandlerRegistration hr =
new HandlerRegistration (this, Long.MAX_VALUE);
toSk = to.register (selector, SelectionKey.OP_WRITE, hr);
}
boolean needMore2 = sendBuffer (toBuffer, from, fromLogger);
if (needMore2) {
HandlerRegistration hr =
new HandlerRegistration (this, Long.MAX_VALUE);
fromSk = from.register (selector, SelectionKey.OP_WRITE, hr);
}
if (!(needMore1 || needMore2))
registerRead ();