JAkub Scholz created PROTON-363:
-----------------------------------

             Summary: recv.exe fails on Windows XP because getnameinfo returns 
WSANO_DATA / error 11004
                 Key: PROTON-363
                 URL: https://issues.apache.org/jira/browse/PROTON-363
             Project: Qpid Proton
          Issue Type: Bug
          Components: proton-c
    Affects Versions: 0.5
         Environment: Windows XP, Visual Studio 2010
            Reporter: JAkub Scholz


I build the proton-c library on Windows XP using Visual Studio 10. Afterwards, 
when trying to run the recv.exe and send.exe examples, the recv.exe always 
fails with:

> recv.exe amqp://~0.0.0.0:5672
getnameinfo: The requested name is valid and was found in the database, but it 
does not have the correct associated data being resolved for.

It doesn't fail immediately after start but only when I attempt to connect with 
send.exe. As a result, the Proton seems to be pretty much not working on my 
machine.

---

The error seems to originate from the function pn_listener_accept in driver.c 
and it translates to WSANO_DATA error / error 11004. I did some digging around 
and playing with the getnameinfo function and it seems to me, that the problem 
is that the getnameinfo function is unable to recognize the service name based 
on the port number. And - according to MSDN 
(http://msdn.microsoft.com/en-us/library/windows/desktop/ms738532(v=vs.85).aspx)
 - that on Windows Server 2003 and earlier results in error (on Windows Vista 
and later this works fine).

If I add a flag NI_NUMERICSERV to the getnameinfo call: 
code = getnameinfo((struct sockaddr *) &addr, addrlen, host, 1024, serv, 64, 
NI_NUMERICSERV)
it will not return an error but return success and use the port number as a 
service name. And with this change the recv.exe starts working fine.

However, adding this flag will on Windows Vista and higher and in Linux 
probably result in the service name being always returned as a port number and 
not as a name. So I'm not sure it is desired to add this flag on all platforms. 

Regards
Jakub

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to