bindWebsocket

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

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

Parameters

requestMessageType

the type of each message received via websocket

responseMessageType

the type of each message to be sent via websocket

function

a function of the receiver

route

a route