use of com.webpieces.http2engine.api.client.InjectionConfig in project webpieces by deanhiller.
the class AbstractTest method setUp.
@Before
public void setUp() throws InterruptedException, ExecutionException {
mockChannel.setIncomingFrameDefaultReturnValue(CompletableFuture.completedFuture(mockChannel));
Http2Config config = new Http2Config();
//start with 1 max concurrent
config.setInitialRemoteMaxConcurrent(1);
localSettings.setInitialWindowSize(localSettings.getMaxFrameSize() * 4);
config.setLocalSettings(localSettings);
InjectionConfig injConfig = new InjectionConfig(mockTime, config);
Http2Client client = Http2ClientFactory.createHttpClient(mockChanMgr, injConfig);
mockChanMgr.addTCPChannelToReturn(mockChannel);
httpSocket = client.createHttpSocket("simple");
CompletableFuture<Http2Socket> connect = httpSocket.connect(new InetSocketAddress(555));
Assert.assertTrue(connect.isDone());
Assert.assertEquals(httpSocket, connect.get());
//clear preface and settings frame from client
mockChannel.getFramesAndClear();
//server's settings frame is finally coming in as well with maxConcurrent=1
sendAndAckSettingsFrame(1);
}
use of com.webpieces.http2engine.api.client.InjectionConfig in project webpieces by deanhiller.
the class WebServerModule method providesAsyncServerMgr.
@Provides
@Singleton
public HttpFrontendManager providesAsyncServerMgr(ChannelManager chanMgr, ScheduledExecutorService timer, @Named(HttpFrontendFactory.HTTP2_ENGINE_THREAD_POOL) Executor executor1, BufferPool pool, Time time, WebServerConfig config) {
HttpParser httpParser = HttpParserFactory.createParser(pool);
HpackParser http2Parser = HpackParserFactory.createParser(pool, true);
InjectionConfig injConfig = new InjectionConfig(http2Parser, time, config.getHttp2Config());
return HttpFrontendFactory.createFrontEnd(chanMgr, timer, injConfig, httpParser);
}
Aggregations