pushToAll

fun pushToAll(message: String): Result<Unit>(source)

Broadcasts a message to every registered client's endpoint over the common socket. "Registered" here means currently registered - a connection that has been terminate()d, or superseded by a same-name reconnect from a new origin, is pruned and no longer addressed.

Return

Result.success if the message reached every client, or the first failure

Parameters

message

the text to send to all clients


Broadcasts bytes verbatim to every registered client's endpoint over the common socket - no encoding, no trim. Raw-bytes mirror of pushToAll(String). A payload above the OS datagram limit fails the Result (cause logged) rather than being sent.

Return

Result.success if the datagram reached every client, or the first failure

Parameters

bytes

the raw payload to send to all clients