Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-363

recv.exe fails on Windows XP because getnameinfo returns WSANO_DATA / error 11004



    • Bug
    • Status: Closed
    • Major
    • Resolution: Pending Closed
    • proton-0.5
    • None
    • proton-c
    • Windows XP, Visual Studio 2010


      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://~
      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.





            Unassigned Unassigned
            scholzj Jakub Scholz
            0 Vote for this issue
            2 Start watching this issue