Expand description
Socket abstraction and common types
This module provides the core socket abstraction for Scarlet’s network functionality. Following Scarlet’s philosophy, it defines OS-agnostic socket operations that can be used for both internal IPC and external network communication.
§Design Philosophy
Like TTY devices, Scarlet Sockets use neutral, OS-agnostic abstractions:
- Scarlet-private control opcodes (SCTL_SOCKET_*) instead of OS-specific ioctls
- ABI modules translate their specific syscalls to these neutral operations
- Works for both internal (process-to-process) and external (network) communication
§Control Opcodes
Socket control operations use the SCTL_SOCKET_* namespace (magic ‘SS’ = 0x53, 0x53)
Modules§
- socket_
ctl - Scarlet-private, OS-agnostic control opcodes for Socket operations. These are stable only within Scarlet and must be mapped by ABI adapters.
Structs§
- Inet4
Socket Address - IPv4 socket address
- Inet6
Socket Address - IPv6 socket address
- Local
Socket Address - Local socket address for inter-process communication (OS-agnostic, not tied to Unix specifically)
Enums§
- Shutdown
How - Socket shutdown directions
- Socket
Address - Socket address abstraction - OS-agnostic
- Socket
Domain - Socket domain (address family) - neutral to any specific OS
- Socket
Error - Socket errors
- Socket
Protocol - Socket protocol
- Socket
State - Socket state
- Socket
Type - Socket type enumeration
Traits§
- Socket
Control - Socket control operations trait
- Socket
Object - Socket operations trait