This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

TCP receive with DENON Amplifier
#2
receive without timeout will wait until a new line (\n) character is received.

Try this script instead:
Code:
sock = require('socket').tcp()
sock:settimeout(10)

res, err = sock:connect('192.168.0.1', 23)
if res then
  while true do
    res, err, partial = sock:receive()

    if res then
      log('receive', res)
    elseif partial then
      log('partial', partial)
    elseif err == 'closed' then
      break
    end
  end
else
  log('connect failed', err)
end

sock:close()
Reply


Messages In This Thread
TCP receive with DENON Amplifier - by Hadeel - 03.10.2024, 08:32
RE: TCP receive with DENON Amplifier - by admin - 03.10.2024, 09:43

Forum Jump: