21.11.2014 13:11, Michal Kubecek wrote:
> On Fri, Nov 21, 2014 at 10:03:12AM +0200, Vlad Khorsun wrote:
>> 19.11.2014 16:08, Michal Kubecek пишет:
>>
>>> Could you check if first getaddrinfo() call returns EAI_FAMILY on
>>> Windows XP without IPv6 support? The way I read the manual page it
>>> should but I would rather make sure.
>>
>>     On W2K3 without IPv6 i see that getaddrinfo() returns 0 and gai_result
>> contains one entry with ai_family == AF_INET6. But later, call to socket()
>> returns error 10047 (WSAEAFNOSUPPORT). Note, EAI_* codes is just an aliases
>> for WSA* codes. In this case WSAEAFNOSUPPORT is an real error code for
>> EAI_FAMILY.
>
> That's unfortunate... I suppose the easiest way out of this would be
> adding something like
>
> #ifdef WIN_NT
>       if (!host_str && /* Windows version < Vista */)
>               gai_hints.ai_family = AF_INET;
> #endif
>
> This should also take care of XP/2003 with IPv6 support (making the
> server listen on 0.0.0.0 by default).

   I can commit function which checks if IPv6 support is present (it will
be based on WSAEnumProtocols). Can it help ?

>>     BTW, always write OS error code with custom error message !
>
> You mean the number in addition to its text representation?

   I mean that message like this

if (port->port_handle == INVALID_SOCKET)
{
        gds__log("socket: error creating socket (family %d, socktype %d, 
protocol %d",
                        pai->ai_family, pai->ai_socktype, pai->ai_protocol);


is missing important part - reason of failure ;)

Regards,
Vlad

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to