raspberrypi: implement setsockopt(SOL_SOCKET, SO_REUSEADDR)#9084
Conversation
|
...works fine, no exceptions. A number of resets of the server didn't yield any exceptions. We can test the no-reuse case pending the question above. I'm not sure how to reliably trigger the address in use exception though (that may become apparent by clearing SOF_REUSEADDR). |
|
With today's artifact and same latest release of the adafruit_httpserver library, I get if implementation.version >= (9,) or implementation.name != "circuitpython":
sock.setsockopt(socket_source.SOL_SOCKET, socket_source.SO_REUSEADDR, 1)But if I change it to (btw, I'm using |
memcmp() returns -1, 0 or 1 to denote the relative ordering of the two buffers. So, the computation would actually set `enable = 0` in the case where `value` had the same bits set as "one" and `enable = 1` in the case where `value` had any other bits. By changing the compared buffer to be `zero`, `enable` gets a true value whenever the value is NOT exactly 0 (e.g., it's 1, 7, -1, ...), correcting the sense of enable vs disable. Thanks to @anecdata for testing and finding this problem, which previously would have affected the nodelay flag as well.
|
really appreciated the testing @anecdata ! |
untested
edit by @dhalbert:
Fixes #9081.