Skip to content
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

add support for "unix" transport where socket module contains AF_UNIX #829

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

akrpic77
Copy link

@akrpic77 akrpic77 commented Mar 25, 2024

This pull request adds "unix" transport where underlying python's socket module contains AF_UNIX constant. This is, of course, available on all the unices, and since 2017 on Windows 10 too. Although support for it has not yet landed in the cpython.

The use case for this transport is when both broker and client run on the same machine - unix sockets should provide noticable performance gains.

Few remarks:

  1. unix socket is created instead of normal socket, so it is possible to create tls over unix socket, but that is not tested
  2. for client tests, the fake_broker is parametrized for 'tcp', and 'unix', this could also be used for e.g. 'tcp6' test
  3. unix socket filename is currently 'localhost', so it wasn't necessary to modify connect* methods. I don't like it, maybe fake_broker.addr can be added as a tuple with value (host, port) for "tcp" , and (path,) for "unix". This addr field would also come handy later if "tcp6" tests are added.

@PierreF
Copy link
Contributor

PierreF commented Mar 27, 2024

Hello, thanks for your contribution. Could you sign the Eclipse ECA for your contribution to be merged (https://accounts.eclipse.org/user/eca) ?

@akrpic77
Copy link
Author

Done!

tests/testsupport/broker.py Outdated Show resolved Hide resolved
@PierreF PierreF added this to the 2.0.1 milestone Apr 7, 2024
@PierreF PierreF merged commit 27bbdc3 into eclipse-paho:master Apr 29, 2024
10 checks passed
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