network socket

One end of a two-way network connection between programs, identified by an IP address and a port number.

In more detail

A program opens a socket to connect to a server, and the operating system uses the address and port to deliver data to the right program. Many requests to the same server can reuse one open socket.

Examples

In the browser: the TCP handshake sets up the socket and TLS then encrypts what flows through it.
A program asks the kernel for a socket, binds it to a local address and port, and then either listens for connections or connects out. Each open socket is also a file descriptor of its process. ss lists sockets with their state and owning process.
In Node.js a TCP socket is a Duplex stream.
Python's ssl module wraps a plain socket to add TLS on top; the course runs both ends of a handshake over loopback sockets in one process.

Related terms

Taught in

References