Module socket_ctl

Module socket_ctl 

Source
Expand description

Scarlet-private, OS-agnostic control opcodes for Socket operations. These are stable only within Scarlet and must be mapped by ABI adapters.

Constants§

SCTL_SOCKET_BIND
Magic ‘SS’ (0x53, 0x53) followed by sequential IDs to avoid collisions.
SCTL_SOCKET_CONNECT
Connect to remote address (arg = address structure pointer)
SCTL_SOCKET_GETPEERNAME
Get peer address (arg = buffer pointer for address)
SCTL_SOCKET_GETSOCKNAME
Get local address (arg = buffer pointer for address)
SCTL_SOCKET_GET_NONBLOCK
Get socket non-blocking mode (returns 0 or 1)
SCTL_SOCKET_GET_STATE
Get socket state (returns SocketState value)
SCTL_SOCKET_GET_TYPE
Get socket type (returns SocketType value)
SCTL_SOCKET_IS_CONNECTED
Check if connected (returns 0 or 1)
SCTL_SOCKET_LISTEN
Start listening for connections (arg = backlog size)
SCTL_SOCKET_SET_NONBLOCK
Set socket to non-blocking mode (arg: 0=blocking, 1=non-blocking)
SCTL_SOCKET_SHUTDOWN
Shutdown socket (arg: 0=read, 1=write, 2=both)