I am trying to program some sockets, so on the server side I use htonl(INADDR_ANY) . As I understand it, it seems to me that this function generates a random IP (am I correct?). In fact, I want to associate my socket with my localhost . But if I run this
printf("%d",htonl(INADDR_ANY));
I get 0 as the return value. Can someone bring some kind of explanation?
c sockets
epsilones May 12 '13 at 15:02 2013-05-12 15:02
source share