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 ?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…