Using tcp

Added by iNTERFACEWARE

Use the net.tcp module to send and receive using tcp sockets

Source Code
   -- send and receive tcp socket data
   
   -- include port as part of hostname
   local s = net.tcp.connect('hostname:8086')
   s:send(Data)
   local Ack = s:recv()
   s:close()
   
   -- specify port separately from host name
   local s = net.tcp.connect{host=hostname, port=8086}
   s:send(Data)
   local Ack = s:recv()
   s:close()
Description
Use the net.tcp module to send and receive using tcp sockets