Last active
September 6, 2023 07:39
-
-
Save marcelstoer/76fbe0717037498b94bdf866f2748bdd to your computer and use it in GitHub Desktop.
SO 38990950
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://stackoverflow.com/questions/38990950/simulating-esp8266-server-multithreading | |
someint = 5 | |
a = 1 | |
srv:listen(8080,function(conn) | |
conn:on("receive", function(client,request) | |
client:send(someint); | |
client:close(); -- btw, you should wait for 'sent' event before closing, see http://nodemcu.readthedocs.io/en/latest/en/modules/net/#example_6 | |
end) | |
end) | |
while a do | |
someint = someint + 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you !