Repository navigation
fix: support TCP keepalive socket options - #140
Closed
syrusakbary wants to merge 2 commits into
Closed
syrusakbary wants to merge 2 commits into
syrusakbary wants to merge 2 commits into
Conversation
This was referenced Sep 25, 2026
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.
This full TCP keepalive timing work is no longer required for the Pi integration. Edge.js #155 uses the existing basic
SO_KEEPALIVEoption in its native WASIX binding and skips unsupported timing options. Pi works with the stock libc and original WISP transport. Full configurable probe timing is deferred; Wasmer #7035 and libuv #15 are being kept focused on filesystem timestamps.Summary
WASIX libc rejects
TCP_KEEPIDLE,TCP_KEEPINTVL, andTCP_KEEPCNTbefore calling the runtime. Extend the existing TCP option translation and route these three options through the existing integer socket-option getter/setter, so libuv can use its normalsetsockoptcalls.The implementation adds 26 net lines across
setsockopt.candgetsockopt.c. There are no separate keepalive handlers or new helper functions. Wasmer validates keepalive values; libc handles buffer sizes/copying and propagates runtime errors. The shared getter preserves truncated/zero-length output semantics, and the shared setter reads values without assuming alignment. Existing public TCP constant values remain unchanged.The rest of the diff defines/generated-checks the three WASIX option IDs and adds a loopback C regression. WITX #10 appends IDs without changing existing IDs or syscall signatures. Companion runtime: Wasmer #7035. libuv #15 remains timestamp-only, with no socket workaround.
Validation
CHECK_SYMBOLS=yes: exported/undefined symbols, public headers, and exact predefined-macro snapshots pass.-Wall -Wextra -Werrorand passed against the updated Wasmer CLI using the simplified libc. Covers keepalive before/after connection, updates, invalid values/buffers, closed descriptors, and truncated/zero-length getters.SO_RCVBUF, verifying the reused integer-option path.Requires the updated Wasmer runtime; no sysroot package or runtime release is published by this PR. Commits are authored by Codex.