start

fun start(onClientMessage: (String) -> Unit): Result<Unit>(source)

Binds onClientMessage as the message handler on every currently-registered connection. No socket is started - the one shared socket is already running.

Return

Result.success if every connection was actuated, or the first failure

Parameters

onClientMessage

callback invoked with the raw message body whenever any connection receives an application datagram; it runs on the single-threaded dispatch executor, not the caller's thread, so it must return quickly