TCPIP_CONNECT

Syntax

Example

Description/ Remarks

TCPIP_CONNECT connection_number, "TCP/IP_address", Port#, Timeout, "Style"

TCPIP_CONNECT 1, "192.168.4.99", 100, -30, ""

 

See the TCP/IP section for a sample template showing how the TCP/IP commands work together.

This command connects to the machine reading data by specifying its IP address, port number and the time out value in seconds. It returns 1 if it connects successfully and 0 if it fails to connect.

Connection_number:

Valid connection numbers are 1 through 10.

Timeout:

Valid options for this parameter include:

  • A positive number
    Specifies the timeout period, in seconds, for the TCPIP_CONNECT command.

  • -1
    Uses the Windows default TCP/IP timeout period for the TCPIP_CONNECT command.

  • Any negative number (except -1)
    Specifies the timeout period, in seconds, for the TCPIP_CONNECT, TCPIP_RCV and  TCPIP_SENDRCV commands.

For example, to set a 30-second timeout period for both the TCP/IP connection and later TCP/IP receive commands, set the timeout to - 30.

Style:

Style is not used at this time.