Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
SocketCanDaemonBusgains aunix_socket_pathargument: when given, it connects to socketcand through a Unix domain socket (AF_UNIX) instead of TCP, as requested in Socketcand UNIX Socket Support #2018.host/portare then neither required nor allowed.hostandportare now optional (defaultNone); passing neither address form, or a mix of both, raisesCanInitializationErrorbefore any connection attempt. Platforms withoutAF_UNIXraise the same error.tcp_tuneis disabled with a warning for Unix sockets (same pattern as the existing Windows case).connect_to_servernow takes a single address (a(host, port)tuple or a socket path), which is whatsocket.connect()accepts for both families.test/test_socketcand.pyperforms the real handshake plus a send/receive round-trip over both a Unix domain socket and TCP (regression), and covers the invalid configuration combinations.doc/changelog.d/.Related Issues / Pull Requests
Type of Change
Checklist
tox).Additional Notes
Verified locally:
pytest test/test_socketcand.pypasses (8 tests, including the 4 new ones), the publiccan.interface.Bus(interface="socketcand", channel="can0", unix_socket_path=...)route connects against the fake server, andblack --check/ruff check(project pins) are clean on the changed files. Fulltoxwas not run in my environment, and the interface.rstpage was not extended — happy to add that if you prefer it in the same PR.