In this chapter, we will look at how to send and receive User Datagram Protocol (UDP) packets. UDP socket programming is very similar to Transmission Control Protocol (TCP) socket programming, so it is recommended that you read and understand Chapter 3, An In-Depth Overview of TCP Connections, before beginning this one.
The following topics are covered in this chapter:
- The differences between TCP socket programming and UDP socket programming
- The sendto() and recvfrom() functions
- How connect() works on a UDP socket
- Implementing a UDP server using only one socket
- Using select() to tell when a UDP socket has data ready