Changing WiFiServer port at runtime
Posted: Sat Aug 01, 2015 1:22 am
Is it possible / ok to change the port that WiFiServer listens on at runtime?
See test case below (not compile tested).
Thx.
See test case below (not compile tested).
Thx.
Code: Select all
WiFiServer server(9001);
boolean testchange = true;
void setup (void)
{
server.begin()
}
void loop (void) {
if (testchange == true)
{
# Does this work, is it OK to do?
server = WiFiServer(8001);
# Do we need to call begin again?
sever.begin()
testchange = false;
}
....
## Do stuff with server here.
....
}