ssCore.UDP.sendMsg

Send a message using the open socket to a specific IP name or address, using the port specified in UDP.open.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

destination - IP address or network name to send to.

data - Data to send.

addNull - [Optional] - Add a terminating (NULL) character to the end of the supplied data string. Valid values include: true,false. Default value is false.


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.UDP.sendMsg( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

This method can only be called asynchronously.


Notes:

The destination parameter can be an IP address or a name that can be resolved locally or by a DNS server.

For testing purposes, the destination can be the loopback address (127.0.0.1).

                

Examples:

ssCore.UDP.sendMsg({destination:"192.168.123.34", data:"Hello"}, {callback:"messageSent", scope:this});

function messageSent(return_obj, callback_obj, error_obj)
{
    if (return_obj.success)
    {
        // Message was sent successfully.
    }
    else
    {
        ssDebug.trace("ERROR: "+error_obj.description);
    }
}