JavaScript Functions > Virtual Table Server Functions for Single Connection (lrvtc) > Alphabetical Listing of Virtual Table Server Functions (Single Server) > lrvtc.connect

lrvtc.connect

Generates a connection descriptor.

Example Global Functions

Syntax

lrvtc.connect ( serverName, portNumber, options );

Arguments

name Comments
serverName The name or IP address of the VTS server host.
portNumber The port the server is listening on.
options

One of:

  • 0 - No options
  • lrvtc.VTOPT_KEEP_ALIVE - Keep connection alive

The lrvtc.connect function creates a connection to the server.

If a connection already exists, it is automatically disconnected and cleared.

Return Values

Returns zero on success or one of the Error Codes.

Parameterization

All string input arguments can be passed using standard parameterization.

Example

var   VtsServer = "myVTSserver";
var   nPort = 8888;
var   rc;

vuser_init()
{
    rc = lrvtc.connect(VtsServer,nPort,lrvtc.VTOPT_KEEP_ALIVE);
    lr.logMessage("Connect result rc="+ rc);
    return 0;
}