public interface PacketWritestream extends WriteStream<Buffer>
WriteStream
for sending packets to a SocketAddress
.
The stream WriteStream.exceptionHandler(io.vertx.core.Handler<java.lang.Throwable>)
is called when the write fails.Modifier and Type | Method and Description |
---|---|
PacketWritestream |
drainHandler(Handler<Void> handler)
Set a drain handler on the stream.
|
PacketWritestream |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the write stream.
|
PacketWritestream |
setWriteQueueMaxSize(int maxSize)
Set the maximum size of the write queue to
maxSize . |
PacketWritestream |
write(Buffer data)
Write some data to the stream.
|
end, end, writeQueueFull
PacketWritestream exceptionHandler(Handler<Throwable> handler)
WriteStream
exceptionHandler
in interface StreamBase
exceptionHandler
in interface WriteStream<Buffer>
handler
- the exception handlerPacketWritestream write(Buffer data)
WriteStream
WriteStream.writeQueueFull()
method before writing. This is done automatically if using a Pump
.write
in interface WriteStream<Buffer>
data
- the data to writePacketWritestream setWriteQueueMaxSize(int maxSize)
WriteStream
maxSize
. You will still be able to write to the stream even
if there is more than maxSize
bytes in the write queue. This is used as an indicator by classes such as
Pump
to provide flow control.setWriteQueueMaxSize
in interface WriteStream<Buffer>
maxSize
- the max size of the write streamPacketWritestream drainHandler(Handler<Void> handler)
WriteStream
Pump
for an example of this being used.drainHandler
in interface WriteStream<Buffer>
handler
- the handlerCopyright © 2016. All rights reserved.