@Override public void succeeded() { onFillable(); }
@Override protected ServerParser getParser() { return (ServerParser)super.getParser(); }
return task; if (isFillInterested() || shutdown || failed) return null; int filled = fill(getEndPoint(), networkBuffer.buffer); if (LOG.isDebugEnabled()) LOG.debug("Filled {} bytes in {}", filled, networkBuffer); getEndPoint().fillInterested(fillableCallback); return null;
@Override public boolean onIdleExpired() { boolean idle = isFillInterested(); if (idle) { boolean close = session.onIdleTimeout(); if (close) session.close(ErrorCode.NO_ERROR.code, "idle_timeout", Callback.NOOP); } return false; }
@Override public void onFillable() { if (LOG.isDebugEnabled()) LOG.debug("HTTP2 onFillable {} ", this); produce(); }
@Override public void succeeded() { super.onOpen(); promise.succeeded(getSession()); // Only start reading from server after we have sent the client preface, // otherwise we risk to read the server preface (a SETTINGS frame) and // reply to that before we have the chance to send the client preface. produce(); }
@Override public void onOpened(Connection connection) { Session session = ((HTTP2Connection)connection).getSession(); sessions.add(session); LifeCycle.start(session); }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { ServerSessionListener listener = newSessionListener(connector, endPoint); Generator generator = new Generator(connector.getByteBufferPool(), getMaxDynamicTableSize(), getMaxHeaderBlockFragment()); FlowControlStrategy flowControl = getFlowControlStrategyFactory().newFlowControlStrategy(); HTTP2ServerSession session = new HTTP2ServerSession(connector.getScheduler(), endPoint, generator, listener, flowControl); session.setMaxLocalStreams(getMaxConcurrentStreams()); session.setMaxRemoteStreams(getMaxConcurrentStreams()); // For a single stream in a connection, there will be a race between // the stream idle timeout and the connection idle timeout. However, // the typical case is that the connection will be busier and the // stream idle timeout will expire earlier than the connection's. long streamIdleTimeout = getStreamIdleTimeout(); if (streamIdleTimeout <= 0) streamIdleTimeout = endPoint.getIdleTimeout(); session.setStreamIdleTimeout(streamIdleTimeout); session.setInitialSessionRecvWindow(getInitialSessionRecvWindow()); session.setWriteThreshold(getHttpConfiguration().getOutputBufferSize()); ServerParser parser = newServerParser(connector, session); parser.setMaxFrameLength(getMaxFrameLength()); parser.setMaxSettingsKeys(getMaxSettingsKeys()); HTTP2Connection connection = new HTTP2ServerConnection(connector.getByteBufferPool(), connector.getExecutor(), endPoint, httpConfiguration, parser, session, getInputBufferSize(), listener); connection.addListener(sessionContainer); return configure(connection, connector, endPoint); }
return task; if (isFillInterested() || shutdown || failed) return null; int filled = fill(getEndPoint(), networkBuffer.buffer); if (LOG.isDebugEnabled()) LOG.debug("Filled {} bytes in {}", filled, networkBuffer); getEndPoint().fillInterested(fillableCallback); return null;
@Override public boolean onIdleExpired() { boolean idle = isFillInterested(); if (idle) { boolean close = session.onIdleTimeout(); if (close) session.close(ErrorCode.NO_ERROR.code, "idle_timeout", Callback.NOOP); } return false; }
@Override public void onFillable() { if (LOG.isDebugEnabled()) LOG.debug("HTTP2 onFillable {} ", this); produce(); }
@Override public void onOpen() { notifyAccept(getSession()); for (Frame frame : upgradeFrames) getSession().onFrame(frame); super.onOpen(); produce(); }
@Override public void onClosed(Connection connection) { Session session = ((HTTP2Connection)connection).getSession(); if (sessions.remove(session)) LifeCycle.stop(session); }
@Override public void succeeded() { onFillable(); }