The socket is an opening in any fitting that matches the outside diameter of a pipe or tube, with a further recessed through opening matching the inside diameter of the same pipe or tube
Fittings are used in pipe and plumbing systems to connect straight pipe or tubing sections, to adapt to different sizes or shapes, and to regulate fluid flow, for example. Fittings, especially noncommon types, can be expensive, and require time, materials, and tools to install, so they are a non-trivial part of piping and plumbing systems. Valves are technically fittings, but are usually discussed separately.