use of io.vertx.core.http.StreamResetException in project vert.x by eclipse.
the class Http2ClientTest method testClientResetServerStreamDuringResponse.
@Test
public void testClientResetServerStreamDuringResponse() throws Exception {
server.requestHandler(req -> {
req.exceptionHandler(err -> {
assertTrue(err instanceof StreamResetException);
});
req.response().exceptionHandler(err -> {
assertTrue(err instanceof StreamResetException);
assertEquals(10L, ((StreamResetException) err).getCode());
testComplete();
});
req.response().setChunked(true).write(Buffer.buffer("some-data"));
});
startServer();
HttpClientRequest req = client.get(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, "/somepath");
req.handler(resp -> {
resp.exceptionHandler(this::fail);
req.reset(10);
assertIllegalStateException(() -> req.write(Buffer.buffer()));
assertIllegalStateException(req::end);
}).end(Buffer.buffer("hello"));
await();
}
use of io.vertx.core.http.StreamResetException in project vert.x by eclipse.
the class Http2ServerResponseImpl method callReset.
void callReset(long code) {
handleEnded(true);
handleError(new StreamResetException(code));
}
Aggregations