while (responseMsgPos == -1 && bufferedWrites.size() > 0) {
// Try and write any remaining buffer data
Iterator<ByteBufferHolder> holders = bufferedWrites.iterator();
ByteBufferHolder holder = holders.next();
holder.flip();
ByteBuffer buffer = holder.getBuf();
int initialBufferSize = buffer.remaining();
while (responseMsgPos == -1 && buffer.remaining() > 0) {
transferToResponseMsg(buffer);
writeResponseMessage(false);