public static interface WriteFlusher.Listener
A listener of WriteFlusher
events.
Modifier and Type | Method and Description |
---|---|
void |
onFlushed(long bytes)
Invoked when a
WriteFlusher flushed bytes in a non-blocking way,
as part of a - possibly larger - write. |
void onFlushed(long bytes) throws java.io.IOException
Invoked when a WriteFlusher
flushed bytes in a non-blocking way,
as part of a - possibly larger - write.
This method may be invoked multiple times, for example when writing a large buffer: a first flush of bytes, then the connection became TCP congested, and a subsequent flush of bytes when the connection became writable again.
This method is never invoked concurrently, but may be invoked by different threads, so implementations may not rely on thread-local variables.
Implementations may throw an IOException
to signal that the write
should fail, for example if the implementation enforces a minimum data rate.
bytes
- the number of bytes flushedjava.io.IOException
- if the write should failCopyright © 1995–2023 Webtide. All rights reserved.