|
Boost : |
Subject: [boost] [asio] icmp example not working on Windows 2000
From: Wolfgang Fertsak (wolfgang.fertsak_at_[hidden])
Date: 2009-10-23 04:04:44
Hello!
The icmp example provided with the asio-library in 1.40 throws a system
error with code 10044 "The support for the specified socket type does
not exist in this address family." when compiled with _WIN32_WINNT
0x0500 and executed on an Win2000 machine.
The error comes from the gai_echeck()-function in socket_ops.hpp which
is called with family AF_INET and socktype SOCK_RAW:
inline int gai_echeck(const char* host, const char* service,
int flags, int family, int socktype, int protocol)
{ ....
switch (family)
{
case AF_UNSPEC:
break;
case AF_INET:
case AF_INET6:
if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM)
return EAI_SOCKTYPE;
...
I have attached the callstack for call to gai_echeck()
I'm using Visual Studio 2005 and boost 1.39 (although the example is
from boost 1.40)
I changed the return value of gai_echeck() back to 0 in the debugger and
then the rest of the icmp(ping) example ran without any apparent problems.
Best regards,
Wolfgang
boost::asio::detail::socket_ops::gai_echeck(const char * host=0x0012fad0, const char * service=0x0012faa8, int flags=0, int family=2, int socktype=3, int protocol=1) Line 1380 C++
boost::asio::detail::socket_ops::getaddrinfo_emulation(const char * host=0x0012fad0, const char * service=0x0012faa8, const addrinfo * hintsp=0x0012fa78, addrinfo * * result=0x0012faf0) Line 1441 + 0x1d bytes C++
boost::asio::detail::socket_ops::WspiapiGetAddrInfo(const char * host=0x0012fad0, const char * service=0x0012faa8, const addrinfo * hints=0x0012fa78, addrinfo * * result=0x0012faf0, boost::system::error_code & ec={...}) Line 1801 + 0x15 bytes C++
boost::asio::detail::resolver_service<boost::asio::ip::icmp>::resolve(boost::shared_ptr<void> & __formal={...}, const boost::asio::ip::basic_resolver_query<boost::asio::ip::icmp> & query={...}, boost::system::error_code & ec={...}) Line 147 + 0x51 bytes C++
boost::asio::ip::resolver_service<boost::asio::ip::icmp>::resolve(boost::shared_ptr<void> & impl={...}, const boost::asio::ip::basic_resolver_query<boost::asio::ip::icmp> & query={...}, boost::system::error_code & ec={...}) Line 105 + 0x1b bytes C++
boost::asio::ip::basic_resolver<boost::asio::ip::icmp,boost::asio::ip::resolver_service<boost::asio::ip::icmp> >::resolve(const boost::asio::ip::basic_resolver_query<boost::asio::ip::icmp> & q={...}) Line 98 + 0x1d bytes C++
pinger::pinger(boost::asio::io_service & io_service={...}, const char * destination=0x00324199) Line 32 + 0x1a bytes C++
main(int argc=2, char * * argv=0x00324170) Line 155 + 0x16 bytes C++
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk