
Hi, the problem is when you use inet_addr() to assign the address to the sin_addr struct. inet_addr() can return an error of -1 (INADDR_NONE) for invalid input.. unfortunately -1 is actually a valid address (255.255.255.255). inet_pton() handles this situation much better and of course the support for ipv6 Steve
Jambo skunks!
Is there any clear cut advantage in using "inet_pton()" over assigning an IP address to "*sockaddr_in.sin_addr.s_addr*"
*Yaani:-* *inet_pton(AF_INET,host.c_str(),&m_addr.sin_addr);* *VS.* *sockaddr_in**. sin_addr.s_addr = inet_addr(host.c_str());* * * * * * * _______________________________________________
*In programming, as in everything else, to be in error is to be reborn.** * _______________________________________________ *
* _______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke