Websockets
Common code
suspend (ReceiveChannel<M>, SendChannel<N>) -> Unitinterface IWsService {
suspend fun wservice(input: ReceiveChannel<Int>, output: SendChannel<String>) {}
}
expect class WsService : IWsService
object WsServiceManager : KVServiceManager<WsService>(WsService::class) {
init {
GlobalScope.launch(start = CoroutineStart.UNDISPATCHED) {
bind(IWsService::wservice)
}
}
}Frontend code
Backend code
Disconnection
Last updated