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