Repository navigation
Socket buffers: keep the OS default rather than fail; netcode 1.4.9 - #199
Merged
Merged
Conversation
A stock NetBSD 11.0 (kern.sbmax 256 KiB, about 227 KiB usable) refuses every buffer request down to netcode's old 256 KiB floor, so socket create failed and no server or client could start. A larger buffer is an optimisation, not a requirement: the back-off now halves down to 64 KiB, and if nothing is accepted the socket keeps the OS default. Found by yojimbo's NetBSD VM leg. test_socket_buffer_size_back_off covers it with a fake OS, no sockets; it fails with the old 256 KiB floor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
On a stock NetBSD 11.0,
netcode_server_createand client create fail. NetBSD's defaultkern.sbmaxis 256 KiB, of which about 227 KiB is usable, and the socket-buffer back-off gave up below a 256 KiB floor withSOCKOPT_SNDBUF/RCVBUF_FAILED. yojimbo's new NetBSD VM leg found it.A larger socket buffer is an optimisation, not a requirement. The back-off (
netcode_socket_buffer_size_back_off) now halves the request down to 64 KiB, and if nothing is accepted the socket keeps the OS default and logs it at info. Socket creation no longer fails on this. The two error codes that only this path returned are removed. Linux, macOS and Windows behave as before: they clamp, so the first request is accepted. No wire or API change.test_socket_buffer_size_back_offdrives the back-off against a fake OS, with no sockets: one that accepts, a NetBSD-like limit (128 KiB accepted after five refusals), and one that refuses everything (OS default kept, nothing below the minimum requested). It fails with the old 256 KiB floor.kern.sbmaxworkaround removed (linked PR to follow).Version 1.4.9.
🤖 Generated with Claude Code