SingleChannelConnection

A bidirectional channel that can host one service in each direction (1 host and 1 client).

Inheritors

Properties

Link copied to clipboard
abstract val env: KsrpcEnvironment<T>

Functions

Link copied to clipboard
inline suspend fun <T : RpcService, R : RpcService, S> SingleChannelConnection<S>.connect(crossinline host: suspend (R) -> T)

Connects both default channels for a connection (incoming and outgoing).

@JvmName(name = "connectSerialized")
suspend fun <T> SingleChannelConnection<T>.connect(host: suspend (SerializedService<T>) -> SerializedService<T>)

Raw version of connect, performing the same functionality with SerializedService directly.

Link copied to clipboard
abstract suspend fun defaultChannel(): SerializedService<T>

Get a SerializedService that is the default on this client

Link copied to clipboard
abstract suspend fun registerDefault(service: SerializedService<T>)

Register the primary service to be hosted on this communication channel.

Link copied to clipboard
inline suspend fun <T : RpcService, S> SingleChannelHost<S>.registerDefault(service: T)
suspend fun <T : RpcService, S> SingleChannelHost<S>.registerDefault(service: T, obj: RpcObject<T>)

Register a service to be hosted on the default channel.