Network socket
An OS-managed endpoint for network communication, represented as a file descriptor in a process.
Definition
A network socket is an OS-managed endpoint for network communication.
In Unix-like systems, sockets are represented as file descriptors inside a process.
What you do with sockets
At a high level:
- servers create a socket, bind it to an address and port, and listen for connections
- clients create a socket and connect to a server
- both sides send and receive bytes
Why sockets matter for debugging
A large set of “network bugs” are actually socket-level realities: ports in use, permissions, timeouts, connection resets, and resource exhaustion.