ssCore.TCP.open

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


Availability:

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.

ssCore.TCP.open( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

This method can only be called asynchronously.


Notes:

TCP.open 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:

ssCore.TCP.open({destination:"192.168.123.45", port:"5550"}, {callback:"socketOpened", scope:this});

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