Setting up a UDP Socket
We're now going to write some basic server code in UDP. Let's get right into it.
We'll cover the following...
Remember that sockets are just software endpoints that processes write and read data from. They are bound to an IP address and a port. As we will see, the sending process attaches the IP address and port number of the receiving application. The IP address and port number of the sending process are also attached to the packets as headers, but that’s not done manually in the code of the application itself. Networking libraries are provided with nearly all programming languages and they take responsibility for lots of plumbing.
Purpose of the Program
Let’s set up a socket for a UDP server program that works like so:
- The client will send a line of text to the server.
- The server will receive the data and convert each character to uppercase.
- The server will send the uppercase characters to the client.
Access this course and 1400+ top-rated courses and projects.