Module socket

Module socket 

Source
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§

Inet4SocketAddress
IPv4 socket address
Inet6SocketAddress
IPv6 socket address
LocalSocketAddress
Local socket address for inter-process communication (OS-agnostic, not tied to Unix specifically)

Enums§

ShutdownHow
Socket shutdown directions
SocketAddress
Socket address abstraction - OS-agnostic
SocketDomain
Socket domain (address family) - neutral to any specific OS
SocketError
Socket errors
SocketProtocol
Socket protocol
SocketState
Socket state
SocketType
Socket type enumeration

Traits§

SocketControl
Socket control operations trait
SocketObject
Socket operations trait

Type Aliases§

UnixSocketAddress