AsyncChannelRequest

abstract class AsyncChannelRequest<T, I>(val channel: ReceiveChannel<I>? = null, val target: Target = NonSpecifiedTarget, val socketIdleTimeout: Long? = null) : Request

Read and write are called in sequence, hence you have to give the control flow back if you want cooperative multitasking to happen

Inheritors

Constructors

Link copied to clipboard
constructor(channel: ReceiveChannel<I>? = null, target: Target = NonSpecifiedTarget, socketIdleTimeout: Long? = null)

Functions

Link copied to clipboard
open suspend fun close(channel: SendChannel<T>)

Optionally send a message The transport connection is not available at this point

Link copied to clipboard
open suspend fun handshake(socket: Socket)
Link copied to clipboard
abstract suspend fun readElement(socket: Socket, sendChannel: SendChannel<T>): Boolean

Called after the initial OKAY confirmation

Link copied to clipboard
abstract fun serialize(): ByteArray

Some requests require a device serial to be passed to the request itself by means of

Link copied to clipboard
Link copied to clipboard
abstract suspend fun writeElement(element: I, socket: Socket)

Called after each readElement

Properties

Link copied to clipboard
val channel: ReceiveChannel<I>? = null
Link copied to clipboard
val socketIdleTimeout: Long? = null
Link copied to clipboard