Hi all,
I am using GCC compiler/Sun Solaris.
I would like to ask in <arpa/inet.h> library, what ip address does the constant "INADDR_BROADCAST" and "INADDR_ANY" represent? What is the effect of binding a socket to these addresses?
Any idea is appreciated, thanks a lot!
~~~~~~~~~~~Here is my code~~~~~~~~`
struct sockaddr_in servAddr;
....
servAddr.sin_family = AF_INET;
servAddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
servAddr.sin_port = htons(1500);
servLen = sizeof(servAddr);
if(bind(sd, (struct sockaddr *) &servAddr, servLen)<0) {
perror("\nERROR : Failed to bind socket for the Listener ");
return ERROR;
.....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`