types of socket

Types of Socket: The Ultimate Guide to Every Socket Type

By Emily Miller
AD

Ask ten people what a socket is and you will likely get ten different answers. A software engineer pictures a network endpoint handling millions of HTTP requests. An electrician thinks of the outlet behind a kitchen counter. A mechanic reaches for a chrome-vanadium fitting that grips a stubborn bolt. A computer builder thinks about the delicate contact array holding a processor in place. The word describes a remarkable range of objects, yet all of them share one purpose: to receive something and hold it securely while work gets done.

That shared purpose hides enormous variation. Choosing the wrong socket type can mean dropped data packets, a fried appliance, a rounded-off bolt head, or a bent CPU pin. This guide breaks the category down by domain, covering network sockets in software, electrical sockets found in walls around the world, and the mechanical and electronic sockets used by tradespeople and hardware engineers.

Network Sockets: The Foundation of Digital Communication

In software, a socket is an endpoint for sending and receiving data, and it is almost always created through the Berkeley sockets API. The socket() system call takes two critical arguments: an address family and a socket type. The address family determines the addressing scheme, such as AF_INET for IPv4, AF_INET6 for IPv6, AF_UNIX for local inter-process communication, and AF_BLUETOOTH or AF_NETLINK for specialized use cases. The socket type determines the communication semantics, and that is where the practical differences live.

AD
Types of Electrical Sockets | Plug Socket Quick Guide (Cheat Sheet)
Types of Electrical Sockets | Plug Socket Quick Guide (Cheat Sheet)
World Electrical Outlets Cheat Sheet
World Electrical Outlets Cheat Sheet
Electrical shapes for Microsoft Visio
Electrical shapes for Microsoft Visio

Once created, a network socket behaves much like a file descriptor. Programmers call functions such as bind, listen, accept, connect, send, and recv to move data. Modern languages wrap these primitives in friendly abstractions, but the underlying socket type still dictates reliability, message ordering, latency, and how much kernel state each connection consumes. Choosing between them is an architectural decision, not a detail.

Stream Sockets and the TCP Handshake

A stream socket, declared as SOCK_STREAM, maps to TCP. It is connection-oriented, which means both endpoints must complete a three-way handshake of SYN, SYN-ACK, and ACK before any payload moves. Once the connection exists, the socket delivers an ordered, reliable byte stream: every byte arrives exactly once, in the order it was sent. Lost segments are retransmitted automatically, and flow control prevents a fast sender from overwhelming a slow receiver.

Don’t Mix These Up!
Don’t Mix These Up!
an appliance with various electrical parts labeled in english and spanish on the screen
an appliance with various electrical parts labeled in english and spanish on the screen
RM Electronics
RM Electronics

That reliability has a cost. The handshake adds a round trip before data flows, per-connection state consumes memory on both machines, and strict ordering means one delayed segment blocks everything behind it, a problem known as head-of-line blocking. Stream sockets power the protocols most people rely on daily, including HTTP and HTTPS, FTP, SMTP, IMAP, and SSH, as well as database connections and most remote procedure call frameworks.

Datagram Sockets and the Fast Path

A datagram socket, declared as SOCK_DGRAM, maps to UDP. It is connectionless: no handshake, no session, no delivery guarantee. Each packet is an independent message with its own destination address, which means packets can arrive out of order, arrive twice, or never arrive at all. The trade-off is speed and simplicity. UDP headers are only eight bytes, there is no congestion control by default, and the kernel keeps almost no per-peer state.

AD

Developers reach for datagram sockets when latency matters more than perfection. DNS queries, DHCP leases, NTP time synchronization, voice over IP, live video transport, and online game traffic all lean on UDP. It also supports multicast and broadcast, which TCP cannot do natively, making it the natural choice for service discovery and telemetry broadcasts. Modern protocols such as QUIC layer their own reliability on top of UDP to get the best of both worlds.

various types of electrical switches and plugs on a white background with the names below them
various types of electrical switches and plugs on a white background with the names below them
the electrical components are labeled in this poster, which includes different types of switches and sockets
the electrical components are labeled in this poster, which includes different types of switches and sockets
various types of electrical plugs and sockets on a gray background with text describing them
various types of electrical plugs and sockets on a gray background with text describing them
the types of connectors are labeled in red, white and blue on a purple background
the types of connectors are labeled in red, white and blue on a purple background
the different types of power outlets with flags on them are shown in this poster
the different types of power outlets with flags on them are shown in this poster
various types of plugs are shown on a pink background with the words, types of plugs
various types of plugs are shown on a pink background with the words, types of plugs

Raw, Unix Domain, and Specialized Socket Types

A raw socket, SOCK_RAW, bypasses the transport layer entirely and hands the application direct access to IP headers. This is how tools like ping, traceroute, and packet sniffers operate, and how engineers prototype custom protocol stacks. Raw sockets require elevated privileges on most operating systems and are frequently disabled on shared hosting because they can be abused for spoofing and network scanning.

Not every socket involves a network at all. Unix domain sockets, addressed through AF_UNIX, connect processes on the same machine using a filesystem path or an abstract namespace. They avoid the TCP/IP stack, so they are significantly faster than loopback TCP, and they are used by the Docker daemon, PostgreSQL, MySQL, systemd, and web server to PHP-FPM communication. Beyond those, SOCK_SEQPACKET preserves message boundaries while maintaining order, Netlink sockets carry kernel-to-userspace messages on Linux, and Bluetooth stacks expose their own socket families for RFCOMM and L2CAP links.

AD

Electrical Sockets: Power Delivery Around the World

An electrical socket is a wall-mounted receptacle that connects an appliance to mains power. The international landscape is fragmented: the IEC classifies roughly fifteen distinct plug and socket types, labeled A through N, with voltages clustered around 100 to 127 volts or 220 to 240 volts and frequencies of either 50 or 60 hertz. This patchwork exists because national grids were built before global standards, and because safety philosophies diverged as electricity spread.

Ctorch Switch and Socket
Ctorch Switch and Socket
the electrical wiring diagram shows different types of wires and plugs
the electrical wiring diagram shows different types of wires and plugs
πŸ”Œ A collection of sockets used around the world. 🌎
πŸ”Œ A collection of sockets used around the world. 🌎
Tipos de sockets para focos
Tipos de sockets para focos

Physical incompatibility is only half the problem. Travelers often assume a plug adapter solves everything, but an adapter changes the shape of the pins, not the voltage or the frequency. A device rated for 120 volts plugged into a 230-volt socket through a simple adapter will be destroyed. Stepping voltage up or down requires a converter or transformer sized to the appliance's wattage.

Socket TypeCommon RegionsTypical Rating
Type AUnited States, Canada, Japan, Mexico15 A, 125 V
Type BUnited States, Canada, Mexico15 A, 125 V
Type CEurope, South America, Asia2.5 A, 250 V
Type FGermany, Spain, Netherlands, Scandinavia16 A, 250 V
Type GUnited Kingdom, Ireland, Singapore, Hong Kong13 A, 250 V
Type IAustralia, New Zealand, China, Argentina10 to 16 A, 250 V
Type D and MIndia, South Africa, Nepal6 to 16 A, 250 V

North American Outlets: Type A and Type B

The Type A socket, standardized as NEMA 1-15, accepts a plug with two flat parallel blades. It is ungrounded, rated for 15 amps at 125 volts, and remains common in older homes across the United States and Canada. Its successor, Type B or NEMA 5-15, adds a round grounding pin below the blades. That third conductor gives fault current a safe path to earth and is required by modern electrical codes for most new installations.

AD

North American outlets also come in higher-capacity variants. NEMA 5-20 provides 20 amps and uses a T-shaped neutral slot so standard 15-amp plugs still fit. NEMA 14-50, a four-prong 240-volt socket, feeds electric ranges, welders, and home EV chargers. Polarization is another subtle safety feature: the neutral blade is slightly wider than the hot blade, forcing plugs into the socket in one orientation only.

European and International Outlet Standards

The Type C Europlug, with two round 4-millimeter pins, is the closest thing Europe has to a universal low-power connector. It fits into most continental sockets and is rated for 2.5 amps. The Type F Schuko socket, standard in Germany, Spain, and the Netherlands, is recessed and adds two side grounding clips that contact the plug shell. Type E, used in France and Belgium, achieves the same grounding through a protruding pin in the socket itself. Both accept Europlugs.

The United Kingdom took a different path with Type G, also known as BS 1363. Its three rectangular pins form a triangle, the socket is shuttered, and every plug carries its own fuse, an unusual feature that protects the cord rather than the building circuit. Type I serves Australia, New Zealand, China, and Argentina with two angled flat blades and a vertical ground pin. Type D, common in India, and the larger Type M used in South Africa and parts of India, both use three round pins. Switzerland, Denmark, and Italy each maintain their own Type J, K, and L sockets, though all three accept the Type C Europlug.

Safety-Enhanced and Smart Outlets

Beyond shape, sockets differ in the protective circuitry built around them. A ground fault circuit interrupter, known in other regions as a residual current device, continuously compares current on the hot and neutral conductors and trips within roughly 25 to 40 milliseconds if they diverge, cutting power before a shock can cause cardiac arrest. North American codes require this protection in bathrooms, kitchens, garages, basements, and outdoor locations. Arc fault circuit interrupters address a different hazard by detecting the signature electrical noise of a damaged or loose wire.

Tamper-resistant sockets with internal shutters have been mandatory in the United States since 2008, preventing children from inserting foreign objects. Above the safety layer sits a growing market of convenience features: outlets with integrated USB-A and USB-C ports supporting Power Delivery, switched sockets with individual toggles that are standard in the UK and India, and smart outlets using Wi-Fi, Zigbee, or Matter to add scheduling, energy monitoring, and voice control. Surge-protective receptacles round out the category by clamping voltage spikes before they reach sensitive electronics.

Mechanical and Electronic Sockets: Tools and Chips

Step into a workshop or a computer assembly line and the word socket reappears with an entirely different meaning. Here it describes a fitting that grips a fastener, or a carrier that holds an integrated circuit without soldering it permanently. The design priorities shift from protocol semantics to torque transfer, contact resistance, and dimensional precision measured in fractions of a millimeter.

In both cases the underlying constraint is identical to the software world: the socket must match what it holds. A mismatched profile strips a bolt head or bends a processor pin, and both failures are expensive. Understanding drive sizes, point counts, pin arrays, and land patterns is what separates a smooth repair from a ruined component.

Socket Wrenches: Drives, Points, and Materials

A socket wrench fitting is defined first by its drive size, the square opening that accepts the ratchet or extension. Common sizes run from 1/4 inch for small fasteners, through 3/8 inch for general automotive work, to 1/2 inch, 3/4 inch, and 1 inch for heavy equipment. The second defining characteristic is the internal profile. A six-point socket grips a hex fastener on its flats and resists rounding, while a twelve-point socket engages corners and offers more swing angle in tight spaces at the cost of higher slippage risk. Deep sockets accommodate protruding studs, and shallow sockets fit where clearance is minimal.

Materials matter as much as geometry. Hand sockets are forged from chrome vanadium steel for hardness and corrosion resistance. Impact sockets are made from softer, thicker chrome molybdenum steel so they deform rather than shatter under the shock of a power tool. The specialty list is long: spark plug sockets with internal rubber retainers, universal swivel sockets for awkward angles, pass-through sockets that grip damaged nuts, and bit sockets for Torx, hex, Phillips, and triple-square fasteners. Spline and E-Torx profiles serve automotive applications, and metric versus SAE sizing determines whether a fitting will actually seat.

CPU and IC Sockets: LGA, PGA, BGA, and DIP

Processor sockets connect a chip to a motherboard while allowing replacement. In a land grid array, the spring-loaded pins live in the socket and the processor carries flat gold pads, an arrangement Intel has used for years in sockets such as LGA 1700 and LGA 1851. In a pin grid array, the pins sit on the processor and drop into holes in the socket, which is how AMD built AM4. Notably, AMD switched to a land grid array with AM5, showing that socket philosophies evolve with manufacturing tolerances.

Not every chip gets a socket. Ball grid array packages are soldered directly to the board with tiny solder spheres, which is standard for mobile processors, GPUs, and most embedded systems where size and signal integrity outweigh upgradeability. Older designs relied on dual in-line package sockets and zero insertion force sockets with a lever that lifts the contacts, still used today for EEPROMs, microcontrollers, and chip testing. Every one of these formats demands strict compatibility: processor, socket, chipset, and firmware must all align before a system will post.

The humble socket keeps splitting into more specialized forms. Software continues to push UDP and Unix domain sockets into new territory with protocols like QUIC and high-performance I/O frameworks, while USB-C and Power Delivery steadily erode the tangle of wall adapters that once defined international travel, and tool manufacturers keep refining profiles for fasteners made of aluminum, titanium, and composites. The next time you plug something in, run a network service, or tighten a bolt, take a moment to notice which socket you are actually using. Matching the connector to the job is still the single most reliable way to avoid a costly mismatch.

AD