First time posting here, please be nice to the noob
Can someone please explain the following code line by line?
server=net.createServer(net.TCP)
server:listen(80, function(connection)
connection:on("receive", function(connection,payload)
print(payload)
connection("<h1> Hello </h1>")
end)
connection:on("sent",function(connection) connection:close()
end)
end)
I've gotten my esp8266-01 to execute the following code and (running the latest nodemcu firmware) and I am able to access the message "Hello" via the IP of the esp8266-01 once it's connected to the access point, but I am unsure of what the code means (another words, it works, I just don't know how ) I would really appreciate if someone could help me step through the code above.
p.s. I understand part of the but thought it would be nice to get someone who actually knows every bit of it to explain from scratch. I would also appreciate any recommendations int he direction of learning lua (esp8266 functionality specific if possible, books, guides, anything)
Thanks a bunch in advance for helping out!!!