:Connect()


 

Class

     aprINet()

 

Syntax

     :Connect(cHost, nPort, [nProtocol], [nTimeout] ) --> hSession

 

Parameters

cHost

String, May be a fully-qualified domain name or an IP address.

nPort

Numeric, Port that the remote Server is listening on for connections

nProtocol

Optional: Numeric, Protocol to use for communication with remote server

The protocol to be used when establishing the connection. This may be one of the following values:

Constant

Description

INET_PROTOCOL_TCP

Specifies the Tranmission Control Protocol. This protocol provides a reliable, bi-directional byte stream. This is the default protocol.

INET_PROTOCOL_UDP

Specifies the User Datagram Protocol. This protocol is message oriented, sending data in discrete packets. Note that UDP is unreliable in that there is no way for the sender to know that the receiver has actually received the datagram.

nTimeout

Optional: Numeric. Number of Seconds to wait before resulting in a Timeout Error.

A Value of zero indicates that the process should wait indefinitely for the Server to respond.

 

Return

     If the function succeeds, the return value is a numeric client session value which is stored in :Session.

     If the function fails the return value is -1. To get further error information see :nErr and :cErr

 

Description

:Connect() is used to connect to a remote server

 

See Also

     :Disconnect()