Closed justmobilize closed 4 months ago
@anecdata Thought I would try something. This should work with your multi-internet, using the new method.
Invalid socket for TLS
...Is this branched from main or #157 ?
@anecdata from main
Non-TLS case works fine... router shows the proper LAN IP address in sequence with the code execution. w00t!
Nice!
Oh, after running for a bit, start getting:
Traceback (most recent call last):
File "adafruit_requests.py", line 514, in _get_socket
File "adafruit_wiznet5k_class/adafruit_wiznet5k_socketpool.py", line 198, in socket
File "adafruit_wiznet5k_class/adafruit_wiznet5k_socketpool.py", line 234, in __init__
File "adafruit_wiznet5k_class/adafruit_wiznet5k.py", line 629, in get_socket
RuntimeError: All sockets in use.
Once that happens, no more requests work on that link.
Same behavior with only one Ethernet link.
I'm not using ConnectionManager in that code, but could try that to see if it handles the pool better.
What's the code you are using? The pool isn't managed (just like a built-in one isn't). CM should help if you pass that pool in. You would need to use the new branch that allows for tracking multiple...
The RuntimeError: All sockets in use.
was after catching and ignoring a timeout exception, but somehow I can't replicate that today. Instead I get this sequence on a timeout:
Traceback (most recent call last):
File "code.py", line 37, in <module>
File "adafruit_requests.py", line 591, in get
File "adafruit_requests.py", line 537, in request
File "adafruit_wiznet5k_pr158/adafruit_wiznet5k_socketpool.py", line 274, in wrapper
File "adafruit_wiznet5k_pr158/adafruit_wiznet5k_socketpool.py", line 484, in recv
File "adafruit_wiznet5k_pr158/adafruit_wiznet5k_socketpool.py", line 274, in wrapper
File "adafruit_wiznet5k_pr158/adafruit_wiznet5k_socketpool.py", line 588, in recv_into
timeout: timed out
----------------------------------------
Traceback (most recent call last):
File "code.py", line 37, in <module>
File "adafruit_requests.py", line 591, in get
File "adafruit_requests.py", line 525, in request
File "adafruit_connection_manager.py", line 226, in get_socket
RuntimeError: Socket already connected to...
But, it happens with the existing library too (Scenario "A" in the code below), so it's not unique to this PR (Scenario "B" in the code below).
This is an attempt to create a real
SocketPool
class and so the interface (radio) can be set per-pool.Old style:
New style: