adafruit / Adafruit_CircuitPython_MiniMQTT

MQTT Client Library for CircuitPython
Other
72 stars 50 forks source link

Is `_backwards_compatible_sock` flag still needed #204

Open justmobilize opened 4 months ago

justmobilize commented 4 months ago

Is _backwards_compatible_sock flag still needed? In MQTT._sock_exact_recv there is this code:

        if not self._backwards_compatible_sock:
            # CPython/Socketpool Impl.
            ...

        else:  # ESP32SPI Impl.
            # This will timeout with socket timeout (not keepalive timeout)
            ...

This flag is set by:

self._backwards_compatible_sock = not hasattr(sock, "recv_into")

here

Yet at this point both the ESP32SPI library and WIZNET5k library have recv_into.

The FONA library is the only one I see that doesn't

justmobilize commented 1 month ago

@dhalbert with the cleanup, I would LOVE to pull out the code path in _sock_exact_recv that checks against _backwards_compatible_sock