I am trying to program some sockets and so, on the server side, I use htonl(INADDR_ANY)
. To the extent I understood, it seems to me that this function generates a random IP (am I correct ?). In fact, I want to bind my socket with my localhost
. But if I run this
printf("%d",htonl(INADDR_ANY));
I get 0 as a return value. Could someone bring some explanation ?