Overview
Features
Download
Documentation
Community
Add-Ons & Services

POCO_HAVE_IPv6 enabled on Windows

Please post support and help requests here.

POCO_HAVE_IPv6 enabled on Windows

Postby setsu » 24 Apr 2009, 23:11

If POCO_HAVE_IPv6 is enabled on Windows, /Net/src/IPAddress.cpp has to be changed for me:

// before changes
Code: Select all
IPAddress::IPAddress(const void* addr, poco_socklen_t length)
{
   if (length == sizeof(struct in_addr))
      _pImpl = new IPv4AddressImpl(addr);
#if defined(POCO_HAVE_IPv6)
   else if (length == sizeof(struct in6_addr))
      _pImpl = new IPv6AddressImpl(addr);
#endif
   else throw Poco::InvalidArgumentException("Invalid address length passed to IPAddress()");
}

// after changes
Code: Select all
IPAddress::IPAddress(const void* addr, poco_socklen_t length)
{
   if (length == sizeof(struct in_addr))
      _pImpl = new IPv4AddressImpl(addr);
#if defined(POCO_HAVE_IPv6)
   else if (length == sizeof(struct in6_addr))
      _pImpl = new IPv6AddressImpl(addr);
#if defined(_WIN32)
   else if (length == sizeof(struct sockaddr_in6))
      _pImpl = new IPv6AddressImpl(addr);
#endif
#endif
   else throw Poco::InvalidArgumentException("Invalid address length passed to IPAddress()");
}

Is it reasonable?
setsu
 
Posts: 11
Joined: 12 Jan 2008, 11:29
Location: Japan

Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron