Skip to content

allow to set socket timeout #116

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 5 commits into from
Aug 18, 2022
Merged

Conversation

vladak
Copy link
Contributor

@vladak vladak commented Aug 17, 2022

This change allows to set socket timeout via the init function, like so:

 mqtt_client = MQTT.MQTT(
        broker=secrets["broker"],
        port=secrets["broker_port"],
        socket_pool=pool,
        ssl_context=ssl.create_default_context(),
        socket_timeout=3,
    )

I verified with strace that the poll() syscall timeout value reflects the socket_timeout parameter.

Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

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

A couple of suggestions, thanks for the submission!

@tekktrik
Copy link
Member

Thanks! Looks like that description should get broken up into a couple lines to make the linter happy, but looks ready to go after that!

Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@tekktrik tekktrik merged commit 68cf825 into adafruit:main Aug 18, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 19, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4040 to 1.2.12 from 1.2.11:
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4040#15 from sokratisvas/add-type-annotations
  > Fix version strings in workflow files
  > Update version string

Updating https://github.com/adafruit/Adafruit_CircuitPython_HID to 5.3.0 from 5.2.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#100 from Neradoc/get-last-received-report
  > Fix version strings in workflow files
  > Update version string

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.4.0 from 5.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#116 from vladak/socket_timeout_tunable
  > Fix version strings in workflow files
  > Update version string
rtwfroody pushed a commit to rtwfroody/Adafruit_CircuitPython_MiniMQTT that referenced this pull request Sep 18, 2022
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.

2 participants