fn address4FromPosix(in: *const posix.sockaddr.in) net.Ip4Address in: *const posix.sockaddr.in14315
14316
14317
14318
14319
14320
14321
14322fn address4FromPosix(in: *const posix.sockaddr.in) net.Ip4Address {
// The network byte order address in `in.addr` is already the byte order we want.
const addr_bytes: *const [4]u8 = @ptrCast(&in.addr);
return .{
.port = std.mem.bigToNative(u16, in.port),
.bytes = addr_bytes.*,
};
}