Summary
A socket is an endpoint for communications. In Perl, a socket looks and acts much like a filehandle. There are several species of socket distinguished by their address families, type, and communications protocol. The most frequently used sockets belong to the AF_INET (Internet) address families, and use either the stream-oriented TCP protocol or the datagram-oriented UDP protocol.
UNIX-domain sockets use addresses based on local filenames, whereas Internet-domain sockets use a combination of IP address and port number. Addresses must be packed into binary form before passing them to any of Perl's built-in network functions.
Perl provides a complete set of functions for interconverting the numeric and symbolic forms of host addresses, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access