sstaub / Ethernet3

Ethernet library for Arduino and Ethernetshield2 / WIZ550io / WIZ850io / USR-ES1 with Wiznet W5500 chip
Other
82 stars 33 forks source link

Change EthernetServer to derive from Print rather than Server #50

Closed LeedanJohnson closed 2 years ago

LeedanJohnson commented 2 years ago

Change EthernetServer to derive from Print class rather than Server class to avoid compiler complaints that the begin(uint16_t) method is pure virtual.

This affects my projects targeting the ESP32. I haven't tested whether this issue exists when targeting other platforms, and I don't know if the derivation from Server is important in some use cases. Regardless, deriving from the Print class resolves the compilation errors for me, and hasn't presented any adverse effects in my use case.

sstaub commented 2 years ago

I don't think it is a good idea to pass core library functions. Also to make a PR because there are platform problems. Also to make a PR which is not tested for the main platforms. You should make an issue to the ESP32 Arduino core.

sstaub commented 2 years ago

To understand why refusing it, is that there are virtual basic classes like Client, Server, UDP which allows to write libraries without knowing which hardware you use.