-
Notifications
You must be signed in to change notification settings - Fork 36
Socket improvements #31
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
Conversation
- Fixed `socket_available` to just report and not flush available UDP data when calling multiple times. - Fixed socket `__exit__` to only disconnect if a TCP (stream) socket. - Connect can now accept domain names like CPython versus only IP addresses. - Added socket `send_to`, `recvfrom`, `recv_into`, `recvfrom_into` methods for better compatibility with CPython socket. - Simplified `recv` and `readline` socket methods due to `available` doing the right thing for both TCP and UDP. - Reformatting to make black happy. - Changes made and tested to make generic socket NTP implementation work: https://github.com/askpatrickw/Adafruit_CircuitPython_NTP/blob/raw_ntp/adafruit_ntp.py
You know, this CI is more trouble than it's worth. I check my code with |
@xorbit I recommend setting up |
Thanks for that tip @tannewt ! With |
Yup! Sorry about that. We've been meaning to add the pre-commit recommendation to the guides but I'm not sure we have yet. |
(Will let Brent review and test.) Thanks for the PR! Sorry for the frustrating CI. |
@xorbit I tried wiznet5k_simpleserver.py on my board (with DHCP disabled) and was unable to see a response echo'd back after I ran: However, I used the wsgi server in the README and had no issues connecting. Same with the Any ideas? |
Odd. I tried it and it seems to work for me. The only difference is that I had DHCP. See this REPL log with debug enabled:
So I wondered if it could be a difference because I was using DHCP, so I redid the test without it:
Not sure why it's different from your test. |
@xorbit It might be an issue with my local network. Thanks for providing hardware debug logs. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 3.3.6 from 3.3.5: > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#56 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 4.3.0 from 4.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#102 from adafruit/dherrada-patch-1 > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#101 from kattni/cleanup-deprecated-code > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#99 from mw46d/main Updating https://github.com/adafruit/Adafruit_CircuitPython_IRRemote to 4.0.3 from 4.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#43 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag to 1.1.5 from 1.1.4: > Merge pull request adafruit/Adafruit_CircuitPython_LSM303DLH_Mag#11 from askpatrickw/fix-repo-url-typo Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 2.1.5 from 2.1.4: > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#30 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_Nunchuk to 1.0.0 from 0.3.0: > Merge pull request adafruit/Adafruit_CircuitPython_Nunchuk#24 from jfurcean/add-values-property Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to 2.1.2 from 2.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_RFM9x#59 from AdamLeyshon/add_snr_property Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.9.0 from 1.8.0: > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#31 from xorbit/master Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.1.0 from 5.0.4: > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#62 from brentru/create-group-feed > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#61 from brentru/small-feed-names > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#60 from askpatrickw/fix-repo-url-typos Updating https://github.com/adafruit/Adafruit_CircuitPython_AVRprog to 1.3.4 from 1.3.3: > Merge pull request adafruit/Adafruit_CircuitPython_AVRprog#20 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.2.5 from 3.2.4: > Merge pull request adafruit/Adafruit_CircuitPython_Motor#51 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO to 2.1.3 from 2.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_SimpleIO#58 from askpatrickw/fix-repo-typo > Added pre-commit-config file Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_datetime
socket_available
to just report and not flush available UDPdata when calling multiple times.
__exit__
to only disconnect if a TCP (stream) socket.addresses.
send_to
,recvfrom
,recv_into
,recvfrom_into
methods for better compatibility with CPython socket.
recv
andreadline
socket methods due toavailable
doing the right thing for both TCP and UDP.https://github.com/askpatrickw/Adafruit_CircuitPython_NTP/blob/raw_ntp/adafruit_ntp.py