Zig 0.17.0-dev (Split by item)
This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig library itself.
Zig › std/ › Io/ › Threaded.zig › netShutdownWindows
netShutdownWindows
Threaded.netShutdownWindows
fn netShutdownWindows (userdata : ?*anyopaque , handle : net .Socket .Handle , how : net .ShutdownHow ) net .ShutdownError !void
File
Code
fn netShutdownWindows (userdata : ?*anyopaque , handle : net .Socket .Handle , how : net .ShutdownHow ) net .ShutdownError !void {
if (!have_networking ) return error .NetworkDown ;
const t : *Threaded = @ptrCast (@alignCast (userdata ));
_ = t ;
switch ((try deviceIoControl (&.{
.file = .{ .handle = handle , .flags = .{ .nonblocking = false } },
.code = windows .IOCTL .AFD .PARTIAL_DISCONNECT ,
.in = @ptrCast (&windows .AFD .PARTIAL_DISCONNECT_INFO {
.DisconnectMode = .{ .SEND = how != .recv , .RECEIVE = how != .send },
.Timeout = -1 ,
}),
})).u .Status ) {
.SUCCESS => {},
.CANCELLED => unreachable ,
.INSUFFICIENT_RESOURCES => return error .SystemResources ,
else => |status | return windows .unexpectedStatus (status ),
}
}