Import with #import "std/socket_linux".
LinuxSocket :: struct { fd: s32; valid: bool; error: s32; }LinuxSocketEvent :: struct { ready: s32; error: s32; }LinuxSocketAddress :: struct { family: u16; port: u16; address: u32; zero: [8]u8; }LinuxPollFd :: struct { fd: s32; events: s16; revents: s16; }LinuxErrno :: () -> s32SocketWaitForEvents :: (socket: LinuxSocket, events: s32, timeout_ms: s32) -> LinuxSocketEventSocketConnectError :: (socket: LinuxSocket) -> s32OpenTCPv4 :: (address: [4]u8, port: u16, timeout_ms: s32) -> LinuxSocketSocketCloseWrite :: (socket: LinuxSocket) -> boolSignal write EOF while keeping this owned descriptor readable. Repeating a successful write shutdown is harmless; SocketClose still releases ownership.
SocketCancel :: (socket: LinuxSocket) -> boolSocketSendAll :: (socket: LinuxSocket, input: []u8, timeout_ms: s32) -> s64SocketReceive :: (socket: LinuxSocket, output: []u8, timeout_ms: s32) -> s64SocketClose :: (socket: *LinuxSocket) -> bool