RB> /* Bind the UDP socket to the server address. */
RB> client.sin_family = AF_INET; /* Server is in Internet Domain
*/
RB> client.sin_port = 0; /* Any port in a storm */
RB> client.sin_addr.s_addr = INADDR_ANY; /* Server's Internet Address
*/
RB> if (bind(s, (struct sockaddr *)&client, sizeof(client)) < 0) {
RB> return(-1);
RB> }
What that is actually doing is binding an address to the *local* end of the
socket, not the remote end. Your comments are wrong.
Given the address that you are binding to the client end, I have to ask: Is
it the *server* end that is receiving the "no route to host" errors ?
¯ JdeBP ®
--- FleetStreet 1.22 NR
* Origin: JdeBP's point, using Squish (2:257/609.3)
|