Expand description
Local Socket Implementation
This module implements local (Unix-like) domain sockets for inter-process communication through named socket paths in the filesystem namespace.
ยงDesign
- Named Sockets: Sockets can be bound to filesystem paths
- Connection Oriented: Uses stream sockets for reliable, ordered data transfer
- NetworkManager Integration: Uses global NetworkManager for socket registry
- Direct Buffer Management: Uses VecDeque for efficient data queuing
ยงSocket States
- Unconnected: Initial state after creation
- Bound: Socket bound to a local address
- Listening: Server socket accepting connections
- Connected: Client socket or accepted connection
Macrosยง
- localsocket_
log ๐
Structsยง
- Local
Socket - Local Socket Implementation
- Socket
Buffer ๐ - Shared buffer structure for socket data
Constantsยง
- LOCALSOCKET_
LOG ๐ - MAX_
BUFFER_ ๐SIZE - Maximum buffer size per socket (64 KB)
- MAX_
HANDLE_ ๐QUEUE_ SIZE - Maximum number of handles that can be queued for transfer This prevents unbounded memory growth from DoS attacks
Functionsยง
- local_
socket_ factory - Socket factory function for local sockets