use of io.undertow.testutils.DebuggingSlicePool in project undertow by undertow-io.
the class H2CUpgradeContinuationTestCase method beforeClass.
/**
* Initializes the server with the H2C handler and adds the echo handler to
* manage the requests.
* @throws IOException Some error
*/
@BeforeClass
public static void beforeClass() throws IOException {
// server and client pool is using 1024 for the buffer size
smallPool = new DebuggingSlicePool(new DefaultByteBufferPool(true, 1024, 1000, 10, 100));
final PathHandler path = new PathHandler().addExactPath(ECHO_PATH, new HttpHandler() {
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
sendEchoResponse(exchange);
}
});
server = Undertow.builder().setByteBufferPool(smallPool).addHttpListener(DefaultServer.getHostPort("default") + 1, DefaultServer.getHostAddress("default"), new Http2UpgradeHandler(path)).setSocketOption(Options.REUSE_ADDRESSES, true).build();
server.start();
// Create xnio worker
final Xnio xnio = Xnio.getInstance();
final XnioWorker xnioWorker = xnio.createWorker(null, OptionMap.builder().set(Options.WORKER_IO_THREADS, 8).set(Options.TCP_NODELAY, true).set(Options.KEEP_ALIVE, true).getMap());
worker = xnioWorker;
}
Aggregations