Chapter 17Programming with Sockets

Most of the more interesting programs that I write involve sockets one way or another. Programming with sockets is fun because it allows applications to interact with other machines on the Internet, which has far more potential than just performing local operations.

A socket is a communication channel that allows machines to communicate over the Internet using the Internet Protocol (IP). In this chapter, we’ll concentrate on the two core protocols of the Internet: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).

UDP lets applications send short messages (called datagrams) to each other, but there is no guarantee of delivery for these messages. They can also arrive out of order. TCP, ...

Get Programming Erlang, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.