Documentation
USCK_SendPacket
Require: IP-Symcon >= 5.0
boolean USCK_SendPacket (int $InstanceID, string $Text, string $ClientIP, int $ClientPort)
Parameters
InstanceID | ID of the UDP socket to be updated |
Text | The string to be sent |
ClientIP | Recipient's IP |
ClientPort | Recipient's port |
Returns
If the command succeeds, it returns TRUE, otherwise FALSE.
Description
Sends the string Text on the UDP socket with the ID InstanceID. The IP ClientIP and port ClientPort are used as recipient addressing.
If ClientIP is left blank, content is sent to the host set in the UDP socket. If broadcast is active, the ClientIP parameter is ignored and the content of $Text is sent to the broadcast address. If ClientPort = 0, then the port set in the UDP socket is used.
Example
//Sends the packet with the data record "Any data record" on the server socket with ID 12345 to the IP:Port 192.168.1.123:1234
USCK_SendPacket(12345, "Any data record", "192.168.1.123", 1234);