private void testConnector0(IoSession session) throws InterruptedException {
EchoConnectorHandler handler = (EchoConnectorHandler) session
.getHandler();
IoBuffer readBuf = handler.readBuf;
readBuf.clear();
WriteFuture writeFuture = null;
for (int i = 0; i < COUNT; i++) {
IoBuffer buf = IoBuffer.allocate(DATA_SIZE);
buf.limit(DATA_SIZE);
fillWriteBuffer(buf, i);
buf.flip();
writeFuture = session.write(buf);
if (session.getService().getTransportMetadata().isConnectionless()) {
// This will align message arrival order in connectionless transport types
waitForResponse(handler, (i + 1) * DATA_SIZE);
}
}
writeFuture.awaitUninterruptibly();
waitForResponse(handler, DATA_SIZE * COUNT);
// Assert data
//// Please note that BufferOverflowException can be thrown