Configure TCP buffers and make flushing explicit - #207
Draft
wangxiao1254 wants to merge 2 commits into
Draft
wangxiao1254 wants to merge 2 commits into
wangxiao1254 wants to merge 2 commits into
Conversation
Expose explicit send and receive socket-buffer sizes through NetIO and TLSConfig. Apply them before listen/connect and the TLS handshake, propagate them to NetIO siblings, and leave operating-system defaults unchanged when both values are zero. Provide an opt-in bandwidth/RTT helper that rounds the bandwidth-delay product to a power-of-two tier and reject explicit sizes the kernel cannot provide.
wangxiao1254
force-pushed
the
fix/wan-socket-policy
branch
from
August 23, 2026 02:21
fa0fedd to
3c84449
Compare
Remove the transport-level sync hook and preserve connection coverage with explicit protocol round trips. Callers that need a peer barrier must exchange a protocol message; flush only drains local output. Fail on NetIO stdio flush errors. Make TraceIO reject null transports, flush its trace before the wrapped channel, create trace files with mode 0600, and report trace write and flush failures.
wangxiao1254
force-pushed
the
fix/wan-socket-policy
branch
from
August 23, 2026 02:45
3c84449 to
030bf9e
Compare
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.
Summary
Make transport buffering configurable before connection setup and give
flush()one precise meaning: drain local output.Changes
tcp::SocketOptionswith explicit send/receive buffer sizes;NetIO::make_sibling();TLSConfigand require defaults for adopted TLS sockets;sync()hook;fflushfailures;TraceIOreject null transports, create trace files with mode0600, flush traces before the wrapped channel, and report write/flush failures.API migration
IOChannel::sync()is removed.flush()when the protocol needs to drain locally buffered output.EMP-OT has a coordinated migration that replaces its remaining synchronization calls with explicit flushes.
Zero-valued socket options retain the operating-system defaults. Explicit buffer requests fail if the kernel cannot provide the requested minimum.
Tests
test_netio,test_tlsio, andtest_traceio: 3/3 passed.Coverage includes buffer derivation, unavailable-buffer rejection, listener/client/sibling inheritance, TLS socket settings, adopted-socket rejection, explicit sibling round trips, send-only draining, ignored flush errors, TraceIO delegation, trace flushing, and file permissions.
Stack
This is PR 2 of 6 and targets
fix/byte-bool-api. After PR 1 merges, this PR can be retargeted tomainwithout changing its diff.