write

suspend fun write(bytes: ByteArray, flush: Boolean = false, timeout: Long)

Sends data to the PGN daemon.

Throws an exception if the operation takes too long.

Parameters

bytes

Raw byte data to send to the daemon.

flush

If true, automatically flush the write channel after queueing the data to be sent.

timeout

Time in milliseconds after which the write operation should be aborted if it still hasn't completed.

Throws

TimeoutCancellationException

if timeout is reached