ChannelTransport

constructor(sendChannel: SendChannel<JSONRPCMessage>, receiveChannel: ReceiveChannel<JSONRPCMessage>, dispatcher: CoroutineDispatcher = Dispatchers.Default)(source)

Parameters

sendChannel

The channel used to send JSON-RPC messages.

receiveChannel

The channel used to receive JSON-RPC messages.

dispatcher

The coroutine dispatcher for the event loop. Defaults to Dispatchers.Default.


constructor(channel: Channel<JSONRPCMessage> = Channel(UNLIMITED), dispatcher: CoroutineDispatcher = Dispatchers.Default)(source)

Creates a ChannelTransport instance using a single channel for both sending and receiving messages.

This constructor simplifies the use of ChannelTransport in scenarios where a single channel is enough for bidirectional communication. A default channel with unlimited capacity is used if no channel is provided.

Parameters

channel

The Channel of JSONRPCMessage instances, used for both sending and receiving. Defaults to a channel with unlimited capacity.

dispatcher

The coroutine dispatcher for the event loop. Defaults to Dispatchers.Default.