use of org.eclipse.jetty.http2.api.server.ServerSessionListener in project jetty.project by eclipse.
the class FlowControlStrategyTest method start.
protected void start(ServerSessionListener listener) throws Exception {
QueuedThreadPool serverExecutor = new QueuedThreadPool();
serverExecutor.setName("server");
server = new Server(serverExecutor);
RawHTTP2ServerConnectionFactory connectionFactory = new RawHTTP2ServerConnectionFactory(new HttpConfiguration(), listener);
connectionFactory.setFlowControlStrategyFactory(FlowControlStrategyTest.this::newFlowControlStrategy);
connector = new ServerConnector(server, connectionFactory);
server.addConnector(connector);
server.start();
client = new HTTP2Client();
QueuedThreadPool clientExecutor = new QueuedThreadPool();
clientExecutor.setName("client");
client.setExecutor(clientExecutor);
client.setFlowControlStrategyFactory(FlowControlStrategyTest.this::newFlowControlStrategy);
client.start();
}
use of org.eclipse.jetty.http2.api.server.ServerSessionListener in project jetty.project by eclipse.
the class AbstractTest method start.
protected void start(ServerSessionListener listener) throws Exception {
prepareServer(new RawHTTP2ServerConnectionFactory(new HttpConfiguration(), listener));
server.start();
prepareClient();
client.start();
}
use of org.eclipse.jetty.http2.api.server.ServerSessionListener in project jetty.project by eclipse.
the class AbstractHTTP2ServerConnectionFactory method newConnection.
@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());
ServerParser parser = newServerParser(connector, session);
HTTP2Connection connection = new HTTP2ServerConnection(connector.getByteBufferPool(), connector.getExecutor(), endPoint, httpConfiguration, parser, session, getInputBufferSize(), listener);
connection.addListener(connectionListener);
return configure(connection, connector, endPoint);
}
Aggregations