@SuppressWarnings("unchecked") @Override public void filterClose(NextFilter nextFilter, IoSession session) throws Exception { ((AbstractIoSession) session).getProcessor().remove(session); } }
@SuppressWarnings("unchecked") @Override public void filterClose(NextFilter nextFilter, IoSession session) throws Exception { ((AbstractIoSession) session).getProcessor().remove(session); } }
@SuppressWarnings("unchecked") @Override public void filterClose(NextFilter nextFilter, IoSession session) throws Exception { ((AbstractIoSession) session).getProcessor().remove(session); } }
/** * {@inheritDoc} */ public final void suspendRead() { if (readSuspendCount.getAndIncrement() == 0) { if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); } }
/** * {@inheritDoc} */ public final void suspendWrite() { if (writeSuspendCount.getAndIncrement() == 0) { if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); } }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public final void resumeWrite() { switch (writeSuspendCount.decrementAndGet()) { case -1: throw new IllegalStateException("resumeWrite not balanced by previous suspendWrite"); case 0: if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); break; } }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public final void resumeRead() { switch (readSuspendCount.decrementAndGet()) { case -1: throw new IllegalStateException("resumeRead not balanced by previous suspendRead"); case 0: if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); break; } }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public final void resumeRead() { readSuspended = false; if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); }
/** * {@inheritDoc} */ public final void suspendWrite() { writeSuspended = true; if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); }
private CloseFuture closeOnFlush() { getWriteRequestQueue().offer(this, CLOSE_REQUEST); getProcessor().flush(this); return closeFuture; }
/** * {@inheritDoc} */ public final void suspendWrite() { writeSuspended = true; if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public final void resumeWrite() { writeSuspended = false; if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); }
/** * {@inheritDoc} */ public final void suspendRead() { readSuspended = true; if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); }
/** * {@inheritDoc} */ public final void suspendRead() { readSuspended = true; if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public final void resumeWrite() { writeSuspended = false; if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public final void resumeRead() { readSuspended = false; if (isClosing() || !isConnected()) { return; } getProcessor().updateTrafficControl(this); }
/** * {@inheritDoc} */ public final CloseFuture closeOnFlush() { if (!isClosing()) { getWriteRequestQueue().offer(this, CLOSE_REQUEST); getProcessor().flush(this); } return closeFuture; }
/** * {@inheritDoc} */ public final CloseFuture closeOnFlush() { if (!isClosing()) { getWriteRequestQueue().offer(this, CLOSE_REQUEST); getProcessor().flush(this); } return closeFuture; }
if (writeRequestQueue.isEmpty(session)) { s.getProcessor().write(s, writeRequest); } else { s.getWriteRequestQueue().offer(s, writeRequest); s.getProcessor().flush(s);
@SuppressWarnings("unchecked") @Override public void filterWrite(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception { AbstractIoSession s = (AbstractIoSession) session; // Maintain counters. if (writeRequest.getMessage() instanceof IoBuffer) { IoBuffer buffer = (IoBuffer) writeRequest.getMessage(); // buffer.mark() call is now done in DefaultIoSessionDataStructureFactory$DefaultWriteRequestQueue.poll(). int remaining = buffer.remaining(); if (remaining == 0) { // Zero-sized buffer means the internal message // delimiter. s.increaseScheduledWriteMessages(); } else { s.increaseScheduledWriteBytes(remaining); } } else { s.increaseScheduledWriteMessages(); } s.getWriteRequestQueue().offer(s, writeRequest); if (!s.isWriteSuspended()) { s.getProcessor().flush(s); } }