Player APIs (BrightScript & Ja...
...
Object Reference
Networking Objects
roDatagramSender
3min
this object allows udp packets to be sent to a specified network destination the javascript equivalent is node js dgram api object creation the rodatagramsender object is created with no parameters createobject("rodatagramsender") ifdatagramsender setdestination(destination address as string, destination port as integer) as boolean specifies the destination ip address in dotted quad form along with the destination port this function returns true if successful send(packet as object) as integer sends the specified data packet as a datagram the packet may be a string or an robytearray this method returns 0 upon success and a negative error code upon failure this example script broadcasts a single udp packet containing "hello" to anyone on the network listening on port 21075 sender = createobject("rodatagramsender") sender setdestination("255 255 255 255", 21075) sender send("hello")