Skip to content

Fix socket swap in socket.accept() #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

fasteddy516
Copy link
Contributor

Closes #129. Prevents listening for connections on hardware socket 0 and marking unused sockets as reserved when socket.accept() is called and hardware socket 0 is available.

Tested with CircuitPython 8.2.0-rc.1 on a Raspberry Pi Pico with WIZnet Ethernet Hat (w5100s chipset) using my CircuitPython WIZnet5k Socket Visualizer.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you @fasteddy516

I tested it successfully with a Feather S3 TFT + Ethernet Featherwing (Wiznet5k 5500) using the linked visualizer (neat project, thanks for sharing!) as well as simpletest, cheerlights, and simpleserver examples from inside this repo.

@FoamyGuy FoamyGuy merged commit f313673 into adafruit:main Jul 21, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 22, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 5.0.1 from 3.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#130 from fasteddy516/fix_socket_swap
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#123 from BiffoBear/remove_ntp_client
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#122 from BiffoBear/fix_socket_leaks

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#136 from DJDevon3/WorkingBranch

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
@fasteddy516 fasteddy516 deleted the fix_socket_swap branch September 22, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hardware socket incorrectly reserved in socket.accept() when socket 0 is available.
2 participants