/** * @see IoSession#resumeRead() */ public void resumeRead() { wrappedSession.resumeRead(); }
@Override protected void resumeRead1() { // call super first to trigger processor.consume() super.resumeRead2(); IoSession readSession = this.readSession.get(); if (readSession != null) { readSession.resumeRead(); } }
@Override public void run() { // handle re-alignment race using this instead of super DefaultIoFilterChainEx.this.callNextMessageReceived(entry, session, message); // Note: reads were suspended before scheduling callNextMessageReceived // if suspendRead was called during callNextNessageReceived // then calling resumeRead below will not actually resume reads // due to internal read suspend counter session.resumeRead(); } });
@Override protected void resumeRead1() { // call super first to trigger processor.consume() resumeRead2(); IoSession parent = this.parent.get(); if (parent != null) { parent.resumeRead(); } }
@Override public void operationComplete(WriteFuture future) { int newScheduledWriteBytes = scheduledWriteBytes.addAndGet(-bytesWritten); // Use <= to ensure we resume read in case where both values are 0 if (readSuspended.get() && newScheduledWriteBytes <= thresholdPendingBytes) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("[" + sourceSession.getId() + "->" + attachedSession.getId() + ", " + Thread.currentThread().getName() + "] scheduledWriteBytes " + newScheduledWriteBytes + " <= " + thresholdPendingBytes + ", resuming reads on " + sourceSession); } // KG-2665: handle race with suspendRead, see above. while (readSuspended.compareAndSet(true, false)) { sourceSession.resumeRead(); } } } });
@Override public void filterWrite(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception { super.filterWrite(nextFilter, session, writeRequest); while (!messageQueue.isEmpty() && requestsCompleted.get() == responsesCompleted.get()) { Object message = messageQueue.poll(); if (message == null) { if (logger.isTraceEnabled()) { logger.trace(format("[%s#%s] Resuming reads for HTTP pipelined request", HttpProtocol.NAME, session.getId())); } session.resumeRead(); break; } super.messageReceived(nextFilter, session, message); } }
@Override public void run() { --suspendCount; if (suspendCount == 0) { while(!queue.isEmpty()) { SuspendableEvent event = queue.remove(); try { event.fire(); } catch (Exception e) { session.getFilterChain().fireExceptionCaught(e); } } session.resumeRead(); } } }
private static void resumeReads(Session qfSession, int queueLowerWatermark) { final IoSession ioSession = lookupIoSession(qfSession); if (ioSession != null && ioSession.isReadSuspended()) { ioSession.resumeRead(); qfSession.getLog().onEvent(format(LOWER_WATERMARK_FMT, queueLowerWatermark)); } }
private static void resumeReads(Session qfSession, int queueLowerWatermark) { final IoSession ioSession = lookupIoSession(qfSession); if (ioSession != null && ioSession.isReadSuspended()) { ioSession.resumeRead(); qfSession.getLog().onEvent(format(LOWER_WATERMARK_FMT, queueLowerWatermark)); } }
private void addSslFilter() { minaSession.suspendRead(); minaSession.suspendWrite(); SslFilter filter = new SslFilter(getServerRuntimeContext().getSslContext()); filter.setUseClientMode(clientTLS); minaSession.getFilterChain().addFirst("sslFilter", filter); if(!clientTLS) { minaSession.setAttribute(SslFilter.DISABLE_ENCRYPTION_ONCE, Boolean.TRUE); } minaSession.setAttribute(SslFilter.USE_NOTIFICATION, Boolean.TRUE); minaSession.resumeWrite(); minaSession.resumeRead(); }