@Override
  public Connection newConnection(Connector connector, EndPoint endPoint) {
    ServerSessionListener listener = newSessionListener(connector, endPoint);

    Generator generator = new Generator(connector.getByteBufferPool(), getMaxHeaderTableSize());
    HTTP2ServerSession session =
        new HTTP2ServerSession(
            connector.getScheduler(),
            endPoint,
            generator,
            listener,
            new HTTP2FlowControl(getInitialStreamWindow()));
    session.setMaxLocalStreams(getMaxConcurrentStreams());
    session.setMaxRemoteStreams(getMaxConcurrentStreams());
    long idleTimeout = endPoint.getIdleTimeout();
    if (idleTimeout > 0) idleTimeout /= 2;
    session.setStreamIdleTimeout(idleTimeout);

    Parser parser = newServerParser(connector.getByteBufferPool(), session);
    HTTP2Connection connection =
        new HTTP2ServerConnection(
            connector.getByteBufferPool(),
            connector.getExecutor(),
            endPoint,
            parser,
            session,
            getInputBufferSize(),
            listener);

    return configure(connection, connector, endPoint);
  }
コード例 #2
0
 private HTTPSession(short version, Connector connector) {
   super(
       version,
       connector.getByteBufferPool(),
       connector.getExecutor(),
       connector.getScheduler(),
       null,
       getEndPoint(),
       null,
       1,
       proxyEngineSelector,
       null,
       null);
 }