-
Notifications
You must be signed in to change notification settings - Fork 2
Bus adapter changes #4
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
Changes from all commits
70d0f2b
7487dac
4751e96
fbf255f
148f2cb
6deea57
d6fe2cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1 +1,59 @@ | ||||||
| # lib-protocol-proxy | ||||||
| # Protocol Proxy | ||||||
|  | ||||||
|  | ||||||
| [](https://github.com/eclipse-volttron/lib-protocol-proxy/actions/workflows/run-tests.yml) | ||||||
| [](https://pypi.org/project/protocol-proxy/) | ||||||
|
|
||||||
| This library provides the user with the ability to automatically deploy and manager proxy processes for handling | ||||||
| network communication with remote devices using various protocols. A proxy to each remote peer is established in | ||||||
| a separate process from the managing application. A manager class handles socket communication between the proxy | ||||||
| subprocess and its owner. Individual protocols are implemented as plugins to this library. Integration with | ||||||
| event and asyncio event loops are supported for each of the proxy and manager processes. | ||||||
|
|
||||||
|
|
||||||
| ## Automatically installed dependencies | ||||||
| - python = ">=3.10,<4.0" | ||||||
|
|
||||||
| [//]: # (# Documentation) | ||||||
|
|
||||||
| [//]: # (More detailed documentation can be found on [ReadTheDocs](https://eclipse-volttron.readthedocs.io/en/latest/external-docs/lib-protocol-proxy/index.html. The RST source) | ||||||
|
|
||||||
| [//]: # (of the documentation for this component is located in the "docs" directory of this repository.) | ||||||
|
|
||||||
| # Installation | ||||||
| This library can be installed using pip: | ||||||
|
|
||||||
| ```shell | ||||||
| pip install lib-protocol-proxy | ||||||
| ``` | ||||||
|
|
||||||
| Protocol Proxy plugins should include "protocol-proxy" as a requirement, so users of existing | ||||||
| plugins are encouraged to instead install the plugin for that pacakge directly. | ||||||
|
||||||
| plugins are encouraged to instead install the plugin for that pacakge directly. | |
| plugins are encouraged to instead install the plugin for that package directly. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -146,12 +146,19 @@ def _receive_headers(self, s: socket) -> ProtocolHeaders | None: | |||||||||||||||||||||||
| try: | ||||||||||||||||||||||||
| received = s.recv(2) | ||||||||||||||||||||||||
| if len(received) == 0: | ||||||||||||||||||||||||
| _log.warning(f'{self.proxy_name} received closed socket from ({s.getpeername()}.') | ||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||
| peer_name = f' from {s.getpeername()}.' | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| peer_name = f' from {s.getpeername()}.' | |
| peer_name = f' from {s.getpeername()}' |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String formatting issue: When getpeername() succeeds, peer_name is set to f' received from: {s.getpeername()}.' (with a trailing period), but this creates double periods in the error message. The period should be removed from the peer_name assignment on line 158, or the message should be structured differently to avoid duplication.
| peer_name = f' received from: {s.getpeername()}.' | |
| peer_name = f' received from: {s.getpeername()}' |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String formatting issue: The log message has an extra space before {peer_name}. It should be f'{self.proxy_name}: Received unknown method name: {headers.method_name}{peer_name} with request ID: {headers.request_id}' (without the space before {peer_name}). When peer_name is empty, it produces an extra space, and when it's populated with from [address], it already has a leading space.
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String formatting issue: When getpeername() succeeds, peer_name is set to f': {s.getpeername()}.' (with a leading colon and trailing period), but the log message already has : before it, creating double colons: "Unable to read headers from socket: : [address].". The leading colon should be removed from the peer_name assignment on line 213.
| peer_name = f': {s.getpeername()}.' | |
| except OSError: | |
| peer_name = '.' | |
| _log.warning(f'{self.proxy_name}: Unable to read headers from socket: {peer_name}') | |
| peer_name = f' {s.getpeername()}' | |
| except OSError: | |
| peer_name = '' | |
| _log.warning(f'{self.proxy_name}: Unable to read headers from socket:{peer_name}') |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String formatting issue: The log message is missing "socket" between "Outbound" and the peer name. It should be f'Outbound socket {peer_name} was ready, but no outbound message was found.' When peer_name is empty, it produces "Outbound socket to was ready" which is grammatically incorrect, and when it's populated, it produces "Outbound socket to to [address]" with duplicate "to".
| peer_name = f'to {s.getpeername()}' | |
| except OSError: | |
| peer_name = '' | |
| _log.warning(f'Outbound socket to {peer_name} was ready, but no outbound message was found.') | |
| peer_name = s.getpeername() | |
| except OSError: | |
| peer_name = None | |
| if peer_name: | |
| _log.warning(f'Outbound socket {peer_name} was ready, but no outbound message was found.') | |
| else: | |
| _log.warning('Outbound socket was ready, but no outbound message was found.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in "manager": "the ability to automatically deploy and manager proxy processes" should be "the ability to automatically deploy and manage proxy processes".