refactor(rtps): adopt the new Socket option API (set_receive_buffer_size) - #716
Merged
Conversation
…tsockopt Fast-follow to the socket-option API (#714): the RTPS transport was the only place in the repo still calling setsockopt() on a raw native handle. Use the new espp::Socket::set_receive_buffer_size() for the DATA_FRAG receive-buffer enlarge, dropping the manual native_handle()/SOL_SOCKET/SO_RCVBUF plumbing and its platform-specific reinterpret_cast. Behaviour is unchanged (still best-effort). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Refactors RTPS transport socket receive-buffer sizing to use the newer socket option API (set_receive_buffer_size) instead of calling setsockopt on the native handle.
Changes:
- Replace direct
setsockopt(..., SO_RCVBUF, ...)usage withsocket->set_receive_buffer_size(...)in the RTPS transport channel setup.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
✅Static analysis result - no issues found! ✅ |
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.
Small fast-follow to #714 (the socket
set_option/ buffer-size API).A repo-wide sweep for manual
setsockopt/getsockopton native handles found one call site outside the socket component: the RTPS transport'sSO_RCVBUFenlarge (used, underRTPS_ENABLE_FRAGMENTATION, to keep a burst ofDATA_FRAGdatagrams from being dropped before the reactor drains them). This migrates it to the new API:Behaviour is unchanged (still best-effort — failure ignored). No other repo sites needed migrating (the only other
SO_*mention is a docstring in the python bindings).Verified: host lib builds (fragmentation on, so the migrated path is compiled) and
rtps_facade_fragpasses.🤖 Generated with Claude Code