send

suspend fun send(msg: ByteBuffer): Int

Sends a message to a remote party.

It waits till it is possible to write on the socket. When this method is returned, it does not mean that the msg was sent.

See Also: srt_send

Return

the number of byte sent

Parameters

msg

the ByteBuffer to send. It must be allocate with ByteBuffer.allocateDirect. It sends ByteBuffer from ByteBuffer.position to ByteBuffer.limit.

See also

Throws

if it has failed to send message

if a timeout has been triggered


suspend fun send(msg: ByteBuffer, msgCtrl: MsgCtrl): Int

Sends a message to a remote party.

It waits till it is possible to write on the socket. When this method is returned, it does not mean that the msg was sent.

See Also: srt_sendmsg2

Return

the number of byte sent

Parameters

msg

the ByteBuffer to send. It must be allocate with ByteBuffer.allocateDirect. It sends ByteBuffer from ByteBuffer.position to ByteBuffer.limit.

msgCtrl

the MsgCtrl that contains extra parameter

See also

Throws

if it has failed to send message

if a timeout has been triggered


suspend fun send(msg: ByteArray, offset: Int = 0, size: Int = msg.size): Int

Sends a message to a remote party.

It waits till it is possible to write on the socket. When this method is returned, it does not mean that the msg was sent.

See Also: srt_send

Return

the number of byte sent

Parameters

msg

the ByteArray to send

offset

the offset of the msg

size

the size of the msg to send

See also

Throws

if it has failed to send message

if a timeout has been triggered


suspend fun send(msg: ByteArray, offset: Int, size: Int, msgCtrl: MsgCtrl): Int

Sends a message to a remote party.

It waits till it is possible to write on the socket. When this method is returned, it does not mean that the msg was sent.

See Also: srt_sendmsg2

Return

the number of byte sent

Parameters

msg

the ByteArray to send

offset

the offset of the msg

size

the size of the msg to send

msgCtrl

the MsgCtrl that contains extra parameter

See also

Throws

if it has failed to send message

if a timeout has been triggered