TeleBoss 850 2.06.280_STD User Manual
Page 166
a_lib.TCPConnect
Description
Establish a TCP connection with a remote host.
Syntax
a_lib.TCPConnect(ip_address, port)
a_lib.TCPConnect(ip_address, port, timeout)
a_lib.TCPConnect(ip_address, port, options ...)
a_lib.TCPConnect(ip_address, port, timeout, options ...)
ip_address: The IP address of the remote host
port: The TCP port to connect to
timeout: Connection timeout, in seconds (optional - default is
30)
options: Strings representing socket options:
"telnet" - use telnet option negotiation
Returns
Returns a handle if successful, 'nil' if not.
Example
-- connect to remote host using telnet port
handle = a_lib.TCPConnect("192.168.168.3", 23, 10, "telnet")
-- if connection successful
if handle ~= nil then
-- wait for a prompt
if a_lib.WaitForString(handle, "READY", 5000) ~= nil then
-- do some stuff...
end
-- close the connection
a_lib.TCPClose(handle)
end
a_lib.UDPClose
Description
Closes a UDP socket that has previously been opened using a_lib.UDPListen().
Syntax
a_lib.UDPClose(handle)
handle: The handle obtained when the socket was opened
Returns
Returns 1 if successful, 'nil' if not.
Example
See example for a_lib.UDPReceive.
Summary of Contents for Teleboss 850
Page 6: ......