connect

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).

Provides the host lambda with a stub connected to the default outgoing channel for the connection, and then connects the returned service as the hosted channel for the connection.

This is equivalent to calling registerDefault for T instance and using defaultChannel and toStub to create R.


@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.