RTPacketBuilder

A builder object to construct RTPacket objects

send

signature send()

returns void

Sends this packet to the current session with the given parameters

setData

signature setData(RTDataBuilder rtData)

returns RTPacketBuilder

Sets the RTData of the packet

setOpCode

signature setOpCode(number opCode)

returns RTPacketBuilder

Sets the opCode of the sent packet. Server sent packets will be send with opCode 0 if this is not set

setReliable

signature setReliable(boolean reliable)

returns RTPacketBuilder

Sets the packet to be sent as reliable. By default, server sent packets are sent as unreliable

setSender

signature setSender(number peerId)

returns RTPacketBuilder

Sets the peerId of the sent packet. Server sent packets will be send with peerId 0 if this is not set

setTargetPeers

signature setTargetPeers(Integer[] peerIds)

returns RTPacketBuilder

Sets the peer id's to send the packet to

Did this page help you? Please enter your feedback below. For questions about using this part of the platform, please contact support here