Skip to content

Instantly share code, notes, and snippets.

@marcelstoer
Last active September 6, 2023 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelstoer/76fbe0717037498b94bdf866f2748bdd to your computer and use it in GitHub Desktop.
Save marcelstoer/76fbe0717037498b94bdf866f2748bdd to your computer and use it in GitHub Desktop.
SO 38990950
-- 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
@ravamrt
Copy link

ravamrt commented Sep 6, 2023

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment