sendUDP
Net.sendUDP(hostname, port, byteArray)
Parameters
hostname | Hostname of receiver as a string. |
port | Port to use. |
byteArray | Data to send as a byte array. |
Returns
The length of the byteArray being sent.Description
Sends byteArray over the specified port to the hostname using UDP.
Example
// 1. This corresponds to the ASCII codes for "Hello"
var data = [72, 101, 108, 108, 111];
// 2. Call Net.sendUDP with the hostname, port, and your byteArray
Net.sendUDP("10.0.0.10", 8870, data);
// 1. Call Net.sendUDP with the hostname, port, and your byteArray(hello)
Net.sendUDP("10.0.0.10", 8870, [72, 101, 108, 108, 111]);