Connection
A bidirectional channel that can both host and call services/sub-services.
(Meaning @KsServices can be used for both input and output of any @KsMethod)
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).
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
Get a SerializedService that is the default on this client (i.e. using DEFAULT channel id). This should act as the root service for most scenarios.
Link copied to clipboard
Add a callback to be invoked when SuspendCloseable.close is called.
Link copied to clipboard
Register the primary service to be hosted on this communication channel.
Link copied to clipboard
Register a service to be hosted on the default channel.
Link copied to clipboard
Link copied to clipboard
suspend fun <T : RpcService, S> ChannelHost<S>.registerHost(service: T, obj: RpcObject<T>): ChannelId
Link copied to clipboard
Takes a given channel id and creates a service wrapper to make calls on that channel.