SYS_CONNECT
Syntax
int_val = SYS_CONNECT( host, port, timeout );
- Input arguments
-
string host The hostname or dot address (xxx.xxx.xxx.xxx) of the target host. int port The port number where the server is listening. This must be given in the host byte order, not network order. int timeout The time in milliseconds that this call waits for the connection.
Return Values
- Success:
-
int >0 Socket identification number.
- Failure:
-
int -1 Script interface error. int -2 Host not recognized. int -3 Some other system error.
Description
This function creates and connects an AF_INET/STREAM type socket to a server application that is listening at a given host/port. Socket stays open until it is closed by a call to SYS_CLOSE or the application exits.