As the title says... Chat on...

User avatar
By lorneb
#7485 Hi Guys,

I'll start of by thanking the all the people putting in the hours for this fantastic work.

I've been playing with a web server example, and then found a telnet server example. I know that you can I have one tcp server listening at a time, what I'm trying to do is to work out how to stop and free up a web server and then fire up a telnet server. I have both services in different .lua files.

If I try using .close(svr) it seems to close it but it's not freeing all the event handlers so if data is received I see panic messages in the serial console.

So I'd like to know 1. is it possible to close the tcp server down and restart it with different event handlers
2. oint me to any same code would be great

Thanks in advance
User avatar
By ThomasW
#7590
gwizz wrote:Isn't it possible to have one server listening on port 80 and another listening on port 22?

G


No. It's a limitation in nodeMCU. If you try, you'll get "only one tcp server allowed".
Interestingly, i just learned that if you stop a server as described above and start another one on a different port the module keeps listening on the previous port too (I think this is a bug) but uses the callbacks of the active one.

Thomas