sock.setWriteQueueMaxSize(1000);
Buffer buff = TestUtils.randomBuffer(10000);
//Send data until the buffer is full
vertx.setPeriodic(1, id -> {
sock.write(buff.copy());
if (sock.writeQueueFull()) {
vertx.cancelTimer(id);
sock.drainHandler(v -> {
assertFalse(sock.writeQueueFull());
// End test after a short delay to give the client some time to read the data