Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By martinayotte
#64421 Although I've never tried it, I think it is possible.
You would have to add a new setPort() method, and then using code like this one :
Code: Select alltcpserver.close();
tcpserver.setPort(newport);
tcpserver.begin();


EDIT : If you don't wish to add new setPort() method, it can still be accomplish by using two instances of WiFiServer, one with old port and the other with new port and do the switch like :

Code: Select alltcpserver1.close();
tcpserver2.begin();
User avatar
By JimDrew
#64425 These don't work because WiFiServer has to be defined *before* the Setup() routine. So, whatever name you use for the server throughout your app must be the same. I have tried various things like stopping the current server, creating a new one and then assigning the new one to the old name. Nothing seems to work.