A network socket is an endpoint that binds a process to an IP address and port so the operating system can send and receive data. TCP sockets carry ordered streams after a connection; UDP sockets exchange datagrams without that handshake. Applications never talk to the wire directly; they talk through sockets.
What Is a Socket?
Abisola | Feb 12, 2026
In networking, a socket is the programming interface and abstract endpoint that ties an IP address and a port to a process so data can flow in or out. TCP sockets represent connected streams; UDP sockets send and receive datagrams. Every web request, DNS lookup, and API call ultimately goes through sockets managed by the operating system.
A server typically creates a socket, binds it to an interface and port, listens, and accepts incoming TCP connections (each accepted connection gets its own socket). A client creates a socket and connects to the server’s IP and port. For UDP, bind and then sendto or recvfrom without a persistent connection. The Berkeley sockets API on Unix-like systems became the de facto model; Windows uses Winsock with the same concepts.
How programs use sockets
Higher protocols layer on top: HTTP servers listen on TCP port 443 (TLS) or 80; mail, databases, and game servers each use assigned or custom ports. See also TCP for how reliable streams are delivered.
Sockets, WebSockets, and ports
A WebSocket connection still uses a TCP socket underneath after the HTTP upgrade. “Socket” in API terms is broader than “WebSocket,” which is a specific web protocol. Ports let one IP host many services; combined with IP, they identify the target application for delivery.
Why sockets show up in traffic analysis
Blocking or scoring traffic often works at IP or ASN granularity, but the business logic lives in TCP and UDP ports (443 for HTTPS, 53 for DNS, and so on). Proxy and VPN endpoints terminate or tunnel sockets, changing what publishers see as the client address. Bot operators may open many short-lived sockets from data centers while mimicking browsers at the HTTP layer.
Understanding sockets clarifies what “IP blocking” actually affects and why detection adds behavioral and device signals beyond the address alone. Soft context: site bot detection is not a socket tutorial, but the same endpoints carry the traffic you score. Campaign abuse still maps to click fraud and ad fraud.
Frequently Asked Questions
What is a socket in networking?
What is the difference between TCP and a socket?
TCP is a transport protocol that defines how a reliable byte stream works. A socket is the OS interface a program uses to open, bind, connect, and exchange data, often with TCP under it. You can also create UDP sockets. In short: TCP is the rule set; the socket is the handle your app uses.
How do sockets differ from WebSockets?
A socket is the general networking endpoint in the operating system. A WebSocket is a specific web protocol that starts as HTTP and then upgrades to a long-lived bidirectional channel, still riding on a TCP socket underneath. Saying “socket” in code is broader than saying “WebSocket” in a browser API.