class

RNS::RawChannelWriter(TPacket)

Inherits Reference < Object

Provides an IO-like write interface over a Channel.

Chunks outgoing data (up to 16 KiB), optionally compresses via BZip2, and sends it as StreamDataMessage packets on a given stream_id. Call #close to send an EOF marker. Generic over TPacket to match the channel's packet type.

Constants

COMPRESSION_TRIES = 4
MAX_CHUNK_LEN = 1024 * 16

Constructors

new(stream_id : Int32, channel : Channel(TPacket))
Source

Instance methods

close

Close the writer by sending an EOF message.

Source
readable?
Source
seekable?
Source
writable?
Source
write(data : Bytes) : Int32

Write data to the channel. Returns number of bytes consumed, or 0 if not ready.

Source