fix(examples): repair parser-blocking indentation and frame buffer encoding in EtherSenseServer - #2
Open
magqqgq wants to merge 1 commit into
Open
fix(examples): repair parser-blocking indentation and frame buffer encoding in EtherSenseServer#2magqqgq wants to merge 1 commit into
magqqgq wants to merge 1 commit into
Conversation
…coding in EtherSenseServer ### Description This PR addresses medium-severity code cleanliness and resource handling defects within the `librealsense` Ethernet client-server example[cite: 16]. It repairs parser-blocking indentation errors, standardizes the transmitted frame buffer to strictly use bytes, and removes an invalid unused accept handler[cite: 16]. ### Key Changes * **Executable Correctness (`wrappers/python/examples/ethernet_client_server/EtherSenseServer.py`):** - Fixed parser-blocking indentation issues that previously prevented the script from compiling and running[cite: 16]. - Removed an unused accept-handler path that contained references to undefined data[cite: 16]. * **Resource & Data Handling (`EtherSenseServer.py`):** - Initialized `self.frame_data` as a byte string (`b""`)[cite: 21]. - Standardized the `update_frame` method so that the protocol fields (length, timestamp, and pickled depth data) are consistently packed and concatenated strictly as bytes using `struct.pack` and `pickle.dumps`, resolving a previous defect that mixed text and bytes[cite: 16, 21]. ### Validation & Testing * **Syntax Validation:** The modified Python file successfully passes AST parsing without indentation or syntax errors[cite: 16]. * **Hardware Limitations:** Hardware and network-runtime behavior remain unverified because the native RealSense hardware toolchains and device dependencies are unavailable in the current test environment[cite: 16].
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.
Description
This PR addresses medium-severity code cleanliness and resource handling defects within the
librealsenseEthernet client-server example[cite: 16]. It repairs parser-blocking indentation errors, standardizes the transmitted frame buffer to strictly use bytes, and removes an invalid unused accept handler[cite: 16].Key Changes
wrappers/python/examples/ethernet_client_server/EtherSenseServer.py):EtherSenseServer.py):self.frame_dataas a byte string (b"")[cite: 21].update_framemethod so that the protocol fields (length, timestamp, and pickled depth data) are consistently packed and concatenated strictly as bytes usingstruct.packandpickle.dumps, resolving a previous defect that mixed text and bytes[cite: 16, 21].Validation & Testing