![Asentria Teleboss 850 User Manual Download Page 174](http://html.mh-extra.com/html/asentria/teleboss-850/teleboss-850_user-manual_2981745174.webp)
TeleBoss 850 2.06.280_STD User Manual
Page 168
Returns
If successful, returns received data, length of received data, and remote IP address. If no frame was received,
returns 'nil'.
Example
-- open a socket for listen on port 12345
handle = a_lib.UDPListen(12345)
-- if socket opened successfully
if handle ~= nil then
-- loop around doing stuff
done = false
while not done do
-- do some stuff....
-- check for received frame
data = a_lib.UDPReceive(handle, 128, 500)
if data ~= nil then
-- check for frame telling us to stop
if string.find(data, "quit") then
-- now we're done
done = true
end
end
end
-- when done, close the connection
a_lib.UDPClose(handle)
end
a_lib.UDPSend
Description
Send a frame on UDP socket that has previously been opened using a_lib.UDPOpen().
Syntax
a_lib.UDPSend(handle, data, target_ip, target_port)
handle: The handle obtained when the socket was opened
data: A string containing the data to send
target_ip: IP address of the destination host
target_port: Port number
Returns
If successful, returns number of bytes sent. If unsuccessful, returns 'nil' and error message.
Example
See example for a_lib.UDPReceive.
Summary of Contents for Teleboss 850
Page 6: ......