Utility Functions and C Language Reference > Virtual Table Server Functions (VTS) for C, C#, and Java > Virtual Table Server (VTS) Functions for Multiple Connections > Alphabetical Listing > vtc_connect

vtc_connect

Deprecated. Use lrvtc_connect. Generates a connection descriptor.

C Language

PVCI2 vtc_connect ( char *servername, int portnumber, int options );

C# Language

int vts_multi.connect ( const string servername, int portnumber, LoadRunner.ConnectionOptions options );

Java Language

long Vtc.connect ( const string servername, int portnumber, lrapi.vts.Constants options );
Global Functions

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
  • VTOPT_KEEP_ALIVE - Keep connection alive (C language)
  • LoadRunner.ConnectionOptions.KeepAlive - Keep connection alive (C# language)
  • Constants.VTOPT_KEEP_ALIVE - Keep connection alive (Java language)

The vtc_connect function creates a connection to the server.

Return Values

A connection descriptor. The descriptor is passed to other functions as the pvci argument.

Parameterization

All string input arguments can be passed using standard parameterization.

C Language Example

char  *VtsServer = "myVTSserver";
int   nPort = 8888;

PVCI2 pvci = 0;

vuser_init()
{
    pvci = vtc_connect(VtsServer,nPort,VTOPT_KEEP_ALIVE);
    lr_log_message("pvci=%d\n", pvci);
    return 0;
}

C# Language Example

.Net Multiple Connection Example

Java Language Example

Java Multi-Connection Example