-
Notifications
You must be signed in to change notification settings - Fork 35
Accept method #30
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
Accept method #30
Conversation
Adds socket accept API Adds context manager methods for socket Adds setter for socket socknum Adds status property for socket Corrects bug in remote_port method
@AdamCummick Could you move the test code for this to the |
@brentru Didn't see your message until after that last commit. I'll get a more standard looking example off of the test code shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AdamCummick Thanks for adding the accept method - I have some suggestions and comments.
Adds an __exit__ timeout for disconnect removes socknum setter in favor of direct reference Corrects documentation errors
@brentru I added the requested changes as well as the example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one little q
Adds additional timeout wait on socket close in __exit__ Corrects for occasional duplicate ACK packet that caused a 0 len message to be read.
Noticed an occasional bug where a zero length packet would be read. Wireshark was flagging a duplicate ACK. This was corrected by adding a wait state for the socket to actually close in the exit method. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306 to 1.2.3 from 1.2.2: > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306#17 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_DRV2605 to 1.1.10 from 1.1.9: > Merge pull request adafruit/Adafruit_CircuitPython_DRV2605#26 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_DS1307 to 2.1.4 from 2.1.3: > Merge pull request adafruit/Adafruit_CircuitPython_DS1307#20 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_FXOS8700 to 2.1.4 from 2.1.3: > Merge pull request adafruit/Adafruit_CircuitPython_FXOS8700#21 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_HCSR04 to 0.4.4 from 0.4.3: > Merge pull request adafruit/Adafruit_CircuitPython_HCSR04#23 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX31855 to 3.2.5 from 3.2.4: > Merge pull request adafruit/Adafruit_CircuitPython_MAX31855#22 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX9744 to 1.2.4 from 1.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_MAX9744#14 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP230xx to 2.4.3 from 2.4.2: > Merge pull request adafruit/Adafruit_CircuitPython_MCP230xx#37 from adafruit/reset-keyword Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP4725 to 1.4.1 from 1.4.0: > Merge pull request adafruit/Adafruit_CircuitPython_MCP4725#20 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_MMA8451 to 1.3.4 from 1.3.3: > Merge pull request adafruit/Adafruit_CircuitPython_MMA8451#15 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_MPL3115A2 to 1.2.4 from 1.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_MPL3115A2#16 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 2.1.4 from 2.1.3: > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#28 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8523 to 1.5.2 from 1.5.1: > Merge pull request adafruit/Adafruit_CircuitPython_PCF8523#21 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_PCT2075 to 1.1.6 from 1.1.5: > Merge pull request adafruit/Adafruit_CircuitPython_PCT2075#15 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_PN532 to 2.3.1 from 2.3.0: > Merge pull request adafruit/Adafruit_CircuitPython_PN532#45 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 5.1.1 from 5.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#103 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM69 to 2.1.1 from 2.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_RFM69#34 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_SI4713 to 1.2.4 from 1.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_SI4713#17 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_SI5351 to 1.2.4 from 1.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_SI5351#17 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1305 to 1.3.4 from 1.3.3: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1305#12 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.10.1 from 2.10.0: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#54 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_TC74 to 1.0.1 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_TC74#3 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_TMP006 to 2.1.4 from 2.1.3: > Merge pull request adafruit/Adafruit_CircuitPython_TMP006#13 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_Trellis to 1.3.5 from 1.3.4: > Merge pull request adafruit/Adafruit_CircuitPython_Trellis#17 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2561 to 3.3.4 from 3.3.3: > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#34 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2591 to 1.2.5 from 1.2.4: > Merge pull request adafruit/Adafruit_CircuitPython_TSL2591#19 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4010 to 0.10.5 from 0.10.4: > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4010#15 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_VEML6070 to 3.1.4 from 3.1.3: > Merge pull request adafruit/Adafruit_CircuitPython_VEML6070#18 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_VEML6075 to 1.1.4 from 1.1.3: > Merge pull request adafruit/Adafruit_CircuitPython_VEML6075#14 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.2.4 from 1.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_VL6180X#16 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_VS1053 to 1.2.4 from 1.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_VS1053#14 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.8.0 from 1.7.0: > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#30 from AdamCummick/accept-method Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.0.3 from 5.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#57 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_BitmapSaver to 1.1.3 from 1.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_BitmapSaver#13 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_Adafruit to 1.2.2 from 1.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_BLE_Adafruit#11 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_Debouncer to 1.3.8 from 1.3.7: > Merge pull request adafruit/Adafruit_CircuitPython_Debouncer#26 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Button to 1.4.1 from 1.4.0: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#24 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_framebuf to 1.4.4 from 1.4.3: > Merge pull request adafruit/Adafruit_CircuitPython_framebuf#40 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_hashlib to 1.3.2 from 1.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_hashlib#12 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright > Added --force-reinstall to pylint, black, and sphinx install directive Updating https://github.com/adafruit/Adafruit_CircuitPython_IterTools to 1.1.3 from 1.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_IterTools#11 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_OAuth2 to 1.0.2 from 1.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_OAuth2#3 from brentru/fix-dependency-requests Updating https://github.com/adafruit/Adafruit_CircuitPython_TinyLoRa to 2.1.3 from 2.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_TinyLoRa#34 from adafruit/REUSE > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_PIOASM
Adds socket accept API
Adds context manager methods for socket
Adds setter for socket socknum
Adds status property for socket
Corrects bug in remote_port method
Tested with a SAMD51 running CircuitPython 6.0.0
CircuitPython test code:
Python client test code: