use of io.servicetalk.http.netty.HttpClients.forResolvedAddress in project servicetalk by apple.
the class AbstractHttpServiceAsyncContextTest method connectionAcceptorContextDoesNotLeak.
final void connectionAcceptorContextDoesNotLeak(boolean serverUseImmediate) throws Exception {
try (ServerContext ctx = serverWithEmptyAsyncContextService(HttpServers.forAddress(localAddress(0)).appendConnectionAcceptorFilter(original -> new DelegatingConnectionAcceptor(context -> {
AsyncContext.put(K1, "v1");
return completed();
})), serverUseImmediate);
StreamingHttpClient client = HttpClients.forResolvedAddress(serverHostAndPort(ctx)).buildStreaming();
StreamingHttpConnection connection = client.reserveConnection(client.get("/")).toFuture().get()) {
makeClientRequestWithId(connection, "1");
makeClientRequestWithId(connection, "2");
}
}
Aggregations