Writing a UDP Client Program
Let's now write a client to go with the server we wrote.
We'll cover the following...
We'll cover the following...
The Server
Here’s the server code that we have so far for reference.
Creating a Client Socket
Instead of explicitly binding the socket to a given port and IP as we did previously, we can let the OS take care of it. Remember ephemeral ports? Yes, the OS will bind the socket to a port dynamically. So all we really need is to create a UDP socket (line 3).
In fact, we can check ...