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.
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.