GNOME Bugzilla – Bug 331649
prepending the port to the service type is plain wrong
Last modified: 2006-09-29 18:53:20 UTC
See the comments in the thread starting at: http://mail.gnome.org/archives/games-list/2006-February/msg00004.html Daniel makes a very good point about service names.
There's another *real* issue. As it seems you are not de-allocating resources which you did allocate in you Bonjour/Howl related code. Example: (1) sw_discovery_publish(...); (2) sw_discovery_run(session); (3) sw_discovery_fina(session); as it seems step (2) and (3) is missing in games-network.c. see: http://www.porchdogsoft.com/products/howl/docs/index.html (1) DNSServiceRegister(sdRef, ...); (2) DNSServiceProcessResult(...); (3) DNSServiceRefDeallocate(sdRef); it seems step (2) and (3) is missing here as well. see: http://developer.apple.com/documentation/Networking/Conceptual/dns_discovery_api/Articles/registering.html Cheers Daniel S. Haischt
Created attachment 59667 [details] [review] The current patch which adds Avahi support At the time I do have an issue where a client tries to connect to a server.
Another particular interesting issue is, how did u resolve 'foobar.local' addresses? Such an address won't be resolved by a standard DNS server. Thus you have to use for axample nss_mdns which makes the local resolver, resolve such an address. If you do not use such a technique, you should transform a *.local address as it will be return by Zeroconf into an IP address. I did not think you did consider this issue in you current code. Cheers Daniel S. Haischt
Created attachment 60003 [details] [review] Revised patch This patch adds a method called 'games_zeroconf_teardown()' which tries to de-allocate resources related to Zerconf networking. Additionally I did try to fix some Bonjour/Howl issues. Tho, I did only test gainst Avahi for now. Additionally in the games-network-dialog.c file I changed the varaible 'server' to 'lan_server' to enable people to play Zeroconf based LAN games.
I've had a look over the patch and put it in CVS. Things aren't working quite right for me yet, but I'm not certain that I've got my avahi setup correct. I've also changed the autoconf stuff to make Avahi the default (since Avahi is better supported by the rest of GNOME than either Howl or Bonjour).
It would help if you could post what is not working for you.
The symptom is that I can tell one instance of iagno to creat a local game - and it appears to succeed - but a second instance of iagno can't find that game. The most likely cause of this is my system - which hasn't had its zeroconf support seriously tested since I upgraded to an Ubuntu Dapper beta. However, given the choice between hunting simple things like this down and going to bed, I went to bed. I didn't give details since I didn't want you running off on a wild goose chase. I'll be looking into it later today.
My Avahi is configured correctly and I use it frequently with Rhythmbox and Epiphany; I have tested this on my local network between three different systems (Debian Etch, Unstable and Novell SLED 10) and also on loopback and everything is working correctly. Closing. Feel free to reopen it, Callum.
I'm re-opening because none of those patches and comments actually fixed the problem in the title of the bug :). They were mostly about getting Avahi support working(and I got my Avahi support fixed and it all works). The fix is straight-forward, but requires an ABI change, i.e. if we fix this bug then old and new versions of the games can't play against each other. This bug was here to remind me that when we finally did break the protocol (which should hapen anyway, at the very least to get versioning information into it) to change the service type.
The port is prepended to the service type, so that the different games (iagno and gnibbles) which use different ports, will not be able to detect each other using Howl. The service type can be whatever you like, and is used to uniquely identify the service type, if I recall correctly from the Howl documentation. I'm not able to find this documentation now, since Howl is no longer actively developed by Porchdog Software: http://www.porchdogsoft.com/products/howl/
Andreas, are you proposing to stick with the old, completely wrong naming scheme? If you want to differentiate different games from each other, prepend something like _gnibbles. The following proposal is from Apple's BonjourPrinting doc: Service Instance Name = <instance> . <service> . <domain> If you apply this scheme you'll get something like the following example: My Gnibbles Game._gnomegames._udp.local. Port 4711 My 2nd Gnibbles Game._gnomegames._udp.local. Port 4712 My Iagno Game._gnomegames._udp.local. Port 4713 If you realy need to publish a flag that differentiates the different game types you could publish a TXT record type=gnibbles ...
Closing bug, because the code does not exist in CVS anymore.