send

fun send(byteArray: ByteArray): Result<Unit>(source)

Sends raw bytes to targetAddress:sendPort.

Return

Result.success if the datagram was handed to the socket, or Result.failure holding the java.io.IOException that prevented it

Parameters

byteArray

the payload to send


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

Encodes message as UTF-8 and sends it to targetAddress:sendPort.

Return

the outcome of the underlying send call

Parameters

message

the text to send