x, x/os/Socket: initial work on new Socket abstraction #8590
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.
Kick-start initial work on new cross-platform abstraction for sockets. Adds a test for read timeouts and a test for creating a non-blocking socket pair on Linux.
The new Socket abstraction is barebones and is made to support both blocking and non-blocking abstractions, alongside different socket protocols and domains.
Support for platform-dependent socket options that handle unsupported platforms gracefully via. comptime checks are provided for the new Socket abstraction.
This also marks the first out of many commits for introducing breaking changes to the standard library in a separate
x
package folder, which was pre-approved by @andrewrk.The intent for the new
x
package is to introduce new async, event loop, networking, and operating system abstractions that would require breaking the standard library significantly. By having thex
package, code in the standard library and compiler may then slowly be refactored to use thex
package. Once modules in thex
package are stabilized, they can be moved out of thex
package, and a global 'grep' can be done to update import paths that resolve to the stabilized module in thex
package.This also kickstarts addressing #6600. Happy to fix minor things that should be addressed throughout the code in this PR; otherwise a subsequent PR might be better.