07.12.2016, 12:48
Try this:
Code:
require('socket')
ip = '192.168.1.11'
port = 1234
data = string.char(0x08, 0x22, 0x00, 0x00, 0x00, 0x01, 0xd5)
sock = socket.tcp()
sock:settimeout(5)
res, err = sock:connect(ip, port)
if res then
res, err = sock:send(data)
if not res then
alert('send error ' .. tostring(err))
end
else
alert('connect error ' .. tostring(err))
end
sock:close()