Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix socket options for websocket transport #36

Merged
merged 2 commits into from
Feb 16, 2021

Conversation

chmielowiec
Copy link
Contributor

Fixing the following error:

  File /venv/lib/python3.8/site-packages/asyncio_mqtt/client.py", line 81, in connect
    self._client.socket().setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 2048)
AttributeError: 'WebsocketWrapper' object has no attribute 'setsockopt'

Fixing AttributeError: 'WebsocketWrapper' object has no attribute 'setsockopt'
@frederikaalund
Copy link
Collaborator

Hi Robert. Thanks for the pull request. 👍 Let me have a look.

Nice find. I never tested this with a WebSocket-wrapped connection.

I like the fix in general. One comment though: Let's use isinstance instead. I think that's more idiomatic. What do you think?

@chmielowiec
Copy link
Contributor Author

chmielowiec commented Feb 16, 2021

Thanks for quick review! Changed according to your proposal, thanks :-) (still learning python)

Commited without tests, will test it in the evening.

@frederikaalund
Copy link
Collaborator

Super. 👍 Let me know how the test goes. I'll merge it afterwards.

@chmielowiec
Copy link
Contributor Author

Tested, and of course it works perfectly, thanks for the tip!

@frederikaalund frederikaalund merged commit f512fa8 into empicano:master Feb 16, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants