[Qt-interest] QQ article on zeroconf/bonjour: code not working

Brad Howes howes at ll.mit.edu
Mon Mar 30 17:13:02 CEST 2009


On Mar 29, 2009, at 9:29 PM, Nathan Carter wrote:

>
> Now, the unexpected behavior:
> 1. The client, when launched, claims to have found two different
> fortune servers on my machine, although I'm running only one instance
> of the server application.  One of these appears the moment the client
> application is launched, the other after a delay of about 1-2 seconds.

This probably reflects that the server is available over two different  
network devices. The default behavior for a published service is to  
enable provide connection information over all active networks.

> 2. When I click "get fortune," having selected the first of the two
> identical fortune servers, the client pops up a dialog saying "The
> following error occurred: Host unreachable."  I click OK, and the
> dialog reappears (without my having taken any action) again about 5
> seconds later.  I click OK, another 5 second delay, and one final time
> the dialog appears.
> 3. When I insert a debugging statement in Client::connectToServer() in
> client.cpp, I find that my one click of the "get fortune" button
> actually caused three calls to that function in rapid succession,
> giving output like this:
> 	Host ip address: QHostAddress( "FE80:0:0:0:21C:42FF:FE00:1" ) port:
> 56877
> 	Host ip address: QHostAddress( "FE80:0:0:0:21C:42FF:FE00:1" ) port:
> 56877
> 	Host ip address: QHostAddress( "FE80:0:0:0:21C:42FF:FE00:1" ) port:
> 56877

These are IPv6 addresses.

>
> 4. When I click "get fortune," having selected the other of the two
> identical fortune servers, the client prints one debugging message
> like this (after about a 1 second delay) and never pops up a dialog,
> nor fetches a fortune.
> 	Host ip address: QHostAddress( "FD1F:F24:76D2:629A:21B:
> 63FF:FE9D:C18" ) port: 56877

Again, IPv6 addresses. Try disabling IPv6 and see if things improve.

> Anyone have any experience with zeroconf/bonjour and Qt 4.5, or this
> code in particualr?  Thanks!


I've worked extensively with Zeroconf and Qt, and my code still works  
without change after moving to Qt 4.5, so I'm fairly confident that  
the problem you are seeing is not a Qt-specific issue. That said,  
there may be bugs in their code when there are multiple interfaces  
found for a service. When you click on a service to use, it is very  
important that you provide the correct interface ID or else you will  
have problems.

Brad

-- 
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420








More information about the Qt-interest-old mailing list