Opens a socket on the selected port, and prepares it for sending and receiving messages.


First available in version 3.0 build 2039.

Input Parameters:

destination - IP name or address to connect to.

port - Port on the destination system to connect to.

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. paramsObject [, callbackParamsObject] [, errorParamsObject] );

Synchronous Mode:

This method can only be called asynchronously.

Notes: will send an onConnect notification (see TCP.setNotify) if the socket is successfully opened.

In order to receive messages, you must first register for onReceive event notifications.

To send a message on an open socket, use TCP.sendMsg.


Examples:{destination:"", port:"5550"}, {callback:"socketOpened", scope:this});

function socketOpened(return_obj, callback_obj, error_obj)
    if (return_obj.success)
        // Socket was opened successfully.
        ssDebug.trace("ERROR: "+error_obj.description);