use of io.vertx.core.http.impl.WebSocketInternal in project vert.x by eclipse.
the class WebSocketTest method testWriteHandlerFailure.
@Test
public void testWriteHandlerFailure() {
server = vertx.createHttpServer().webSocketHandler(ServerWebSocket::pause).listen(DEFAULT_HTTP_PORT, onSuccess(v1 -> {
Buffer buffer = TestUtils.randomBuffer(1024);
client = vertx.createHttpClient();
client.webSocket(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/someuri", onSuccess(ws -> {
while (!ws.writeQueueFull()) {
ws.write(buffer);
}
ws.write(buffer, onFailure(err -> {
testComplete();
}));
((WebSocketInternal) ws).channelHandlerContext().close();
}));
}));
await();
}
Aggregations