bindWebsocket

fun <REQ, RES> bindWebsocket(route: String? = null, function: suspend T.(ReceiveChannel<REQ>, SendChannel<RES>) -> Unit, requestSerializerFactory: () -> KSerializer<REQ>, responseSerializerFactory: () -> KSerializer<RES>)(source)

Binds a given web socket connection with a function of the receiver.

Parameters

REQ

the type of each message received via websocket

RES

the type of each message to be sent via websocket

route

a route

function

a function of the receiver