NativeEthernet and TCP server port.

Stanleyvc

Active member
Hai All,

My server port is stored in the eeprom.

The server must intialize before its read from the Eeprom.

How can this after the port read from the Eeprom?

uint16_t webPort = (EEPROM.read(9) * 256) + EEPROM.read(10) ;
EthernetServer webServer(webPort);

Thanks.
 
You can do exactly what you've done, or you could also create it with `new EthernetServer(webPort)`.

I'm working on an experimental feature in QNEthernet where you can give the port number in the `begin(port)` function instead of only in the constructor, similar to how you'd do it with `EthernetClient::connect(ip, port)`. That would let you define the instance of an `EthernetServer` separate from giving it the listening port.
 
Back
Top