|
|||||
|
||||||
Other Library Functions |
function |
tcp-connect |
Library: TCP/IP client and server support (OMTCP) legacy
Include: omtcp.xin |
Return type: tcp-connection Returns: |
define external tcp-connection function tcp-connect on value string HostName at value integer PortNum timeout value integer ms (optional)
Argument definitions
Use tcp-connect in a client program to establish a connection to a server program that is running on a specific host machine and port.
You must include the following line at the beginning of your OmniMark program:
include "omtcp.xin"
The address supplied for HostName must be valid (else external exception TCP01).
The port number must fall between 0 and 65535 (else external exception TCP14).
If the connection cannot be made for any reason, the function throws external exception TCP08.
If the timeout value is specified it applies only to the wait for the connection. If the timeout is exceeded, the connection fails.
If the timeout is not specified, tcp-connect "blocks" until a connection is made or some other cause of failure is encountered.
local tcp-connection client set client to tcp-connect on "123.123.123.45" at 5600
Copyright © Stilo International plc, 1988-2008.