s=net.createUDPSocket()
s:on("receive",function(s,c)
---snip---
end)
If I put a dofile in the callback like this:
s=net.createUDPSocket()
s:on("receive",function(s,c)
---snip---
dofile("lcdprint.lua").lcdprint("Testing-1-2-3--",4,0)
---snip---
end)
it is not executed or has no effect.
If it is called like this:
s=net.createUDPSocket()
s:on("receive",function(s,c)
---snip---
tmr.alarm(4, 1000, 1, function() dofile("lcdprint.lua").lcdprint("Testing-1-2-3--",4,0) end )
---snip---
end)
it works - lcdprint is executed.
Can anyone explain why?