1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-07 16:23:38 +03:00

Added WifiServer::begin(uint16_t port) method, listening port can be changed at runtime (#4123)

This commit is contained in:
Luis Carlos Becerra Rueda 2018-01-09 20:10:43 -05:00 committed by Develo
parent 2c8b2b92ce
commit 8765da258b
2 changed files with 6 additions and 0 deletions

View File

@ -56,7 +56,12 @@ WiFiServer::WiFiServer(uint16_t port)
}
void WiFiServer::begin() {
begin(_port);
}
void WiFiServer::begin(uint16_t port) {
close();
_port = port;
err_t err;
tcp_pcb* pcb = tcp_new();
if (!pcb)

View File

@ -51,6 +51,7 @@ public:
WiFiClient available(uint8_t* status = NULL);
bool hasClient();
void begin();
void begin(uint16_t port);
void setNoDelay(bool nodelay);
bool getNoDelay();
virtual size_t write(uint8_t);