On Jan 15, 2009, at 5:55 PM, Sandro Noel wrote: But if I recall my original question was "how does finder associate the proper icon to a server and what is the programatic way of doing it.".
I am pretty certain that the OS does not contact every machine on the subnet to query its AppleTalk daemon. That would result in too much traffic. Network browsing is done using Bonjour, which has been highly optimized to minimize the number of packets sent around. (I implemented the Bonjour presence/IM for iChat, and spent a lot of time working on performance with the networking team.)
It's also possible that SNMP is used to gather this information, as I said earlier; but I'm not sure whether that's enabled by default.
Have you considered using a packet sniffing tool to examine network traffic?
Before claiming that the AFP protocol does not give you the information about the machine maybe you should read the documentation again I did say "as far as I know". I'm not an expert on AFP. Sorry if that led you astray. If there were people with more expertise responding to your questions I'd stay out of the way, but as I know a fair bit about Bonjour and Mac networking in general, and no one else had responded, I thought I'd pitch in.
Let me suggest that "TCP or UDP?" is not the right level of question to be asking, as that answer by itself wouldn't tell you anything useful about how to use AFP.
What you should really be asking is "where can I find documentation on the AFP protocol?" or perhaps "what AFP APIs can I use?" A quick look didn't turn up any actual protocol documentation; I'm pretty sure Apple doesn't document it, and there are a few open-source implementations such as netatalk, but they didn't have any obvious links to protocol docs. In any case, my hunch is that the protocol is probably pretty complex, and that it would be a lot better to look for an OS API that you could call into instead. (But at a higher level, I still feel that using AFP to get the server icon is not the right way to go, or at least not the way the Finder does it.)
—Jens |