Repository navigation
Conversation
… multicast Gaps found when comparing with gnet and the standard library: - WithLoadBalancing: BalanceKernel (default, SO_REUSEPORT hashing), BalanceRoundRobin, BalanceLeastConnections and BalanceSourceAddrHash (by client IP). The latter three share one listening socket; ring 0 accepts and posts each fd to the chosen ring. Connections in transit count towards a ring's load so bursts spread too. - Conn.Peek / Next / Discard / InboundBuffered read the stream incrementally. Bytes in the receive buffer are returned without a copy; unconsumed bytes are kept only for connections that use the API (or already have kept bytes), so others stay on the zero-copy path. Framed's buffer is renamed to keep the two apart. - WithTCPKeepAlive (the unused sockets.TCPKeepAlive field was never applied) and WithSocketBuffers, for accepted (inherited from the listening socket), dialed and UDP sockets. - WithSlowCallbackWarning: callbacks taking longer than the threshold are logged and counted (Stats.SlowCallbacks); a watchdog goroutine reports a callback that is still running, which a measurement after the call cannot. Off by default. - UDP multicast: ListenPacket joins a multicast group address on the interface from WithMulticastInterface (or the default); the rings share one socket so each datagram is delivered once. Tests for each feature pass on both backends (5 runs); the default configuration shows no throughput change against master (0.98-1.04x). CHANGELOG: v0.4.0, including the epoll backend improvements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #33 +/- ##
==========================================
+ Coverage 70.44% 71.36% +0.92%
==========================================
Files 25 28 +3
Lines 2355 2553 +198
==========================================
+ Hits 1659 1822 +163
- Misses 696 731 +35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Closes the gaps found when comparing with gnet and the standard library (items verified against gnet v2.3.3 sources).
WithLoadBalancing:BalanceKernel(default, SO_REUSEPORT),BalanceRoundRobin,BalanceLeastConnections,BalanceSourceAddrHash(client IP). Non-kernel strategies share one listening socket; ring 0 accepts and posts each fd to the chosen ring; connections in transit count towards load so bursts spread too. Test: 40 connections over 4 rings → 10 each (RR, least-conns), all on one ring for one client IP (hash).Conn.Peek/Next/Discard/InboundBuffered. Bytes in the receive buffer come without a copy; unconsumed bytes are kept only for connections that use the API, so others stay zero-copy (tested).WithTCPKeepAlive,WithSocketBuffers: accepted (inherited from the listener), dialed and UDP sockets; verified with getsockopt on the accepted/dialed fds. (Thesockets.TCPKeepAlivefield had never been applied.)WithSlowCallbackWarning: slow callbacks logged +Stats.SlowCallbacks; a watchdog reports callbacks still running. Off by default.ListenPacketon a group address joins it (WithMulticastInterface); rings share one socket so each datagram arrives once.Default-configuration throughput vs master: 0.98–1.04x (interleaved, 5 rounds). All tests pass under
-raceon both backends; new tests 5×; staticcheck clean.CHANGELOG is set to v0.4.0 (also includes the epoll backend improvements from #32). After merging,
v0.4.0will be tagged with a GitHub release.🤖 Generated with Claude Code