Repository navigation
Fixes and improvements in native socket - #3289
Conversation
- Fix mapping SOCK_ENOTCONN error. - Add wait events call on send/receive error to prevent race with lwIP stack. - Adjust TCP_SYNMAXRTX lwIP config to get ~30seconds timeout on connect. - Update declaration of Sys.Net assembly.
WalkthroughThis PR updates the System.Net native interface by adjusting method lookup table indexing and field constants, adds scheduler-aware error handling for non-blocking socket operations, corrects an error code mapping, and standardizes TCP SYN retransmission configuration across multiple platform targets by introducing the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@targets/ESP32/_IDF/sdkconfig.default`:
- Line 58: The TCP SYN retransmission count CONFIG_LWIP_TCP_SYNMAXRTX is set to
4 but does not reach the intended ~30s connect timeout; update
CONFIG_LWIP_TCP_SYNMAXRTX from 4 to 5 so that, given
CONFIG_LWIP_TCP_RTO_TIME=1500 ms, the SYN retransmission schedule yields ~31.5s
total timeout and meets the target.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b3e21377-abbb-4c63-b457-15673a0046c2
📒 Files selected for processing (25)
src/DeviceInterfaces/System.Net/sys_net_native.cppsrc/DeviceInterfaces/System.Net/sys_net_native.hsrc/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cppsrc/PAL/Lwip/lwIP_Sockets.cpptargets/ChibiOS/_include/lwipopts.htargets/ESP32/_IDF/sdkconfig.defaulttargets/ESP32/_IDF/sdkconfig.default.esp32c3targets/ESP32/_IDF/sdkconfig.default.esp32c5targets/ESP32/_IDF/sdkconfig.default.esp32c6targets/ESP32/_IDF/sdkconfig.default.esp32h2targets/ESP32/_IDF/sdkconfig.default.esp32p4targets/ESP32/_IDF/sdkconfig.default.esp32s2targets/ESP32/_IDF/sdkconfig.default.esp32s3targets/ESP32/_IDF/sdkconfig.default_ble.esp32s3targets/ESP32/_IDF/sdkconfig.default_ble_rev3.esp32targets/ESP32/_IDF/sdkconfig.default_nopsram.esp32targets/ESP32/_IDF/sdkconfig.default_nopsram_ble.esp32targets/ESP32/_IDF/sdkconfig.default_nopsram_rev3.esp32targets/ESP32/_IDF/sdkconfig.default_octal_ble.esp32s3targets/ESP32/_IDF/sdkconfig.default_picotargets/ESP32/_IDF/sdkconfig.default_rev3.esp32targets/ESP32/_IDF/sdkconfig.default_rev3.esp32c3targets/ESP32/_IDF/sdkconfig.default_rev3_ipv6.esp32targets/ESP32/_IDF/sdkconfig.default_rev3_noconsole.esp32c3targets/FreeRTOS/_common/include/lwipopts.h
- Restore sock_set_errno in the ESP32 socket API. - Clear the stale EINPROGRESS after connect, so real errors are no longer reported as EWOULDBLOCK. - These were lost in lwIP re-import at nanoframework#3289. - Also add a note to re-apply this after future upstream updates.
Description
Motivation and Context
SocketSystem.Net#373 and - Following AddConnecttoSocketSystem.Net#374How Has This Been Tested?
Screenshots
Types of changes
Checklist
Summary by CodeRabbit
Release Notes
Bug Fixes
Configuration