- All Known Implementing Classes:
ConnectionDataReceiver.DummyStatus, ConnectionDataReceiver.FailedWriteStatus, PacketLocal
- Enclosing class:
MessageOutputStream
public static interface MessageOutputStream.WriteStatus
Interface to detect status of an asynchronous write operation.
Method Summary
All MethodsModifier and TypeMethodDescriptionvoidwaitForAccept(int maxWaitMs) Wait until data write is accepted into outbound queue, indicating space is available.voidwaitForCompletion(int maxWaitMs) Wait until data write either succeeds or fails (ACK received).booleanReturns true if the write was accepted by the outbound queue.booleanReturns true if the write operation failed.
Method Details
waitForCompletion
Wait until data write either succeeds or fails (ACK received).- Parameters:
maxWaitMs- maximum wait time in milliseconds (-1 means wait forever)- Throws:
IOException- if write fails or times outInterruptedException- if waiting thread is interrupted
waitForAccept
Wait until data write is accepted into outbound queue, indicating space is available.- Parameters:
maxWaitMs- maximum wait time in milliseconds (-1 means wait forever)- Throws:
IOException- if acceptance fails or times outInterruptedException- if waiting thread is interrupted
writeAccepted
boolean writeAccepted()Returns true if the write was accepted by the outbound queue.- Returns:
- true if accepted, false otherwise
writeFailed
boolean writeFailed()Returns true if the write operation failed.- Returns:
- true if failed, false otherwise