ArduinoCore-mbed icon indicating copy to clipboard operation
ArduinoCore-mbed copied to clipboard

WiFi and Ethernet library problems. Solutions:

Open JAndrassy opened this issue 2 years ago • 0 comments

The MbedClient is not copyable. There is an attempt to make it survive one copy right after creation, which should work for returning a copy from server.available() but that is not good enough.

Issues: https://github.com/arduino/ArduinoCore-mbed/issues/753 https://github.com/arduino/ArduinoCore-mbed/issues/715

I have a simple fix for the copyability of Client. It just have to test it thoroughly yet. PR https://github.com/arduino/ArduinoCore-mbed/pull/768


The MbedServer doesn't manage connected clients as it should for proper implementation of available and print-to-all-clients. available() here works like Ethernet library's accept() and print-to-all-clients attempts to send a buffer with the listening socket which is not supported in Mbed/LwIP.

I can fix MbedServer too, but in which way? Implement available() and print-to-all-clients? It would break available() for users which already use it as it is? Just rename available() to accept() and add available() as a deprecated alias to accept()? And then even remove inheritance from Server/Print and the write methods, or just leave them with empty implementation?

JAndrassy avatar Nov 21 '23 10:11 JAndrassy