Repository navigation
Conversation
Without an offset, the probe thread sends its probes 4 ms apart and stops the burst when each probe has its answer. A burst that finds no offset tries again after 250 ms. The first offset on this machine now arrives in about 40 ms (it was about 370 ms). Each read in a probe slot now waits only for the time that is left in the slot. Before, a fixed 40 ms read timeout ended a 64 ms slot early. The regular bursts now use the configured probe interval.
Both ends of a data connection now send a keepalive probe after 2 s without traffic, then one each second. After 3 probes without an answer, the kernel ends the connection. On Linux, sent data that has no acknowledgement for 6 s also ends the connection. A connection that died with no close (a pulled cable, a lost Wi-Fi link) now ends in about 5 s. Before, an inlet waited for the 15 s watchdog, and kept the dead socket when the outlet was still visible. On Unix, a read that gives ETIMEDOUT now counts as a lost connection, so the inlet connects again. A read timeout gives EAGAIN there. On Windows, both still count as a quiet connection. The socket2 dependency now uses its all feature, for the probe count and the TCP user timeout.
This was referenced Nov 16, 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.
Stacked on #9. The base is
fix/network-robustness, so this diff shows only the three new commits. After #9 merges, change the base tomain.Summary
Two wire-compatible changes for 0.1.4. A liblsl peer sees no difference.
clock::FIRST_PROBE_INTERVAL). The burst stops when each probe has its answer. A burst that finds no offset tries again after 250 ms (clock::FIRST_RETRY). A reset or a new target clears the offset, so a recovery also gets a fast burst.src/keepalive.rs). Both ends send a probe after 2 s without traffic, then one each second. After 3 probes without an answer, the kernel ends the connection. On Linux,TCP_USER_TIMEOUTof 6 s also ends a connection whose sent data has no acknowledgement.ETIMEDOUTnow ends the connection, so a recovering inlet connects again. A read timeout givesEAGAINthere. On Windows, both still count as a quiet connection.socket2now uses itsallfeature, for the probe count and the user timeout.Not in this PR
Deliberate differences from liblsl
Tests
the_first_offset_arrives_quickly(tests/clock_live.rs, bound 250 ms),a_connected_stream_takes_the_short_timers(reads the options back from the socket),a_kernel_timeout_is_a_lost_connection_on_unix.clippy -D warnings,doc -D warningsand the full workspace tests pass.cargo check --target x86_64-pc-windows-gnupasses.main: plain,--zero-stamps,--desc,--postproc 7and selftest 28/28.--chunk 1626/28 and--sync24/28 (liblsl itself refuses the failing string cells). refuse100, pylsl_check 5/5 and examples pass.Not verified
tc netemor two machines.🤖 Generated with Claude Code