The real problem is that the server isn't binding to an address. As a result, the client can't connect to it.
To bind, you should construct a struct sockaddr_in that has address INADDR_ANY (to bind to all IP4 network interfaces), then use that address with bind().
You're not specifying the network protocol when you create the socket. You may or may not get away with it. The actual value in this case should be IPPROTO_UDP, not zero.
Also, you should close the socket at the end.