sendUDPString

Convert a string to UTF-8 bytes and send the bytes to the provided host/port through UDP.

Syntax

ogscript.sendUDPString (Host, Port, Data);

Parameters

Parameter

Type

Required

Description

Host

String

Yes

Host name to send the given Data string through UDP.

Port

Integer

Yes

Port number on the given Host to send given Data string through UDP.

Data

String

Yes

Data string to convert to bytes and send through UDP to the given Host and Port.

Returns

N/A

Example

This example uses the sendUDPString function to send a message to a particular host/port.

var host = ogscript.getPrivateString('hosts',' Panel.host ');

 

var port = parseInt(ogscript.getPrivateString('hosts',' Panel.port '));

var message = "Hello, can you hear me?";

 

ogscript.sendUDPString(host,port,message);