A WriteStream for sending packets to a SocketAddress. The stream is called when the write fails.

no subtypes hierarchy

Initializer
PacketWritestream(PacketWritestream unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
drainHandlershared actual default PacketWritestream drainHandler(Anything()? handler)

Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue is ready to accept buffers again. See Pump for an example of this being used.

The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced to maxSize / 2.

endshared actual default void end()

Ends the stream.

Once the stream has ended, it cannot be used any more.

endshared actual default void end(Buffer t)

Same as end but writes some data to the stream before ending.

exceptionHandlershared actual default PacketWritestream exceptionHandler(Anything(Throwable)? handler)

Set an exception handler.

setWriteQueueMaxSizeshared actual default PacketWritestream setWriteQueueMaxSize(Integer maxSize)

Set the maximum size of the write queue to maxSize. You will still be able to write to the stream even if there is more than maxSize items in the write queue. This is used as an indicator by classes such as Pump to provide flow control.

The value is defined by the implementation of the stream, e.g in bytes for a NetSocket, the number of Message for a MessageProducer, etc…

writeshared actual default PacketWritestream write(Buffer data)
writeQueueFullshared actual default Boolean writeQueueFull()

This will return true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize

Inherited Methods
Methods inherited from: Object
equals
Methods inherited from: StreamBase
Methods inherited from: WriteStream<T>