mirror of
https://github.com/ziglang/zig.git
synced 2025-12-10 08:13:07 +00:00
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-dependant socket options that handles unsupported platforms gracefully via. comptime checks is 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` 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 the `x` package, code in the standard library and compiler may then slowly be refactored to use the `x` package. Once modules in the `x` package are stabilized, they can be moved out of the `x` package, and a global 'grep' can be done to update import paths that resolve to the stabilized module in the `x` package.
9 lines
154 B
Zig
9 lines
154 B
Zig
const std = @import("../../std.zig");
|
|
|
|
const testing = std.testing;
|
|
|
|
pub const Socket = @import("Socket.zig");
|
|
|
|
test {
|
|
testing.refAllDecls(@This());
|
|
} |