Description
public WriteFuture flush() {
Queue<Object> bufferQueue = getMessageQueue();
WriteFuture future = null;
while (!bufferQueue.isEmpty()) {
Object encodedMessage = bufferQueue.poll();
if (encodedMessage == null)
{ break; } // Flush only when the buffer has remaining.
if (!(encodedMessage instanceof IoBuffer) || ((IoBuffer) encodedMessage).hasRemaining())
}
if (future == null)
{ // Creates an empty writeRequest containing the destination WriteRequest writeRequest = new DefaultWriteRequest(null, null, destination); future = DefaultWriteFuture.newNotWrittenFuture(session, new NothingWrittenException(writeRequest)); } return future;
}
if there are nothing in message queue ,this method try to return a future to represent a NotWritten operation with DefaultWriteRequest, but a IllegalArgumentException was throw while constructing a DefaultWriteRequest with a null message
Attachments
Issue Links
- duplicates
-
DIRMINA-982 ProtocolEncoderOutputImpl.flush() throws an IllegalArgumentException if buffers queue is empty
- Resolved