Re: Getting started communicating with AFP -- on the right track?
Re: Getting started communicating with AFP -- on the right track?
- Subject: Re: Getting started communicating with AFP -- on the right track?
- From: Jesse Armand <email@hidden>
- Date: Mon, 6 Jul 2009 20:02:44 +0800
I'm not sure if this will provide what you want,
But do you think by using Bonjour, it will provide easier AFP communications ?
The service type is _afpovertcp._tcp
Jesse Armand
----------------------------------------
(http://jessearmand.com)
On Sun, Jul 5, 2009 at 1:58 PM, Jerry Krinock<email@hidden> wrote:
>
> On 2009 Jul 04, at 21:12, Eli Bach wrote:
>
>> On Jul 4, 2009, at 3:59 PM, Jerry Krinock wrote:
>>
>> By connecting to a specific network address/port, you already know what
>> protocol that address/port will use (in general).
>
> Thanks, Eli. I believe you're saying that if the struct sockaddr which I
> pass to connect() has its .sin_port set to 548 (which is the default AFP
> port), the server will naturally be expecting an AFP command using the AFP
> protocol. That makes sense.
>
>> Using a url like "afp://10.0.1.204", just says connect using the afp
>> protocol, to the default AFP port at 10.0.1.204. It is possible have afp
>> urls like this "afp://10.0.1.204:1000", which indicates which port to use
>> instead of the default port.
>
> Yes, but we're not doing that because the low-level functions used in the
> Dalrymple & Hillegass book only take addresses and ports, not urls.
>
>> It is possible (but depending on your network, probably highly unlikely)
>> that the server is either 'serving' afp over a different port and/or
>> 'serving' some other protocol using afp's default port.
>
> Well, as long as I'm using the standard way to connect to an AppleShare
> server, if someone has screwed up their ports it's their fault if my app
> can't find 'em.
>
>> I am not aware of a higher-level method for determining the computer name.
>> It is more likely that one is available if the computer has already
>> established a connection to the server than if there is no connection made,
>> vs if there is no connection from your machine to the server.
>
> Good. I believe that Apple is intentionally hiding the names of known
> servers. As I discussed here last week, it is no longer returned by the
> non-depracated Alias Manager function. That's OK. Identifying the horse by
> IP address and then getting the computer name from the horse's mouth seems
> like the correct way to do it anyhow.
>
> I just hope that the "server name" returned by FPGetSrvrInfo in indeed the
> "Computer Name".
>
> I'll try this over the next couple days. I found a project on sourceforge
> which features a function that gets the "FPGetSrvrInfo" info. If I have
> trouble I'll have a peek at how they did it:
>
> http://sourceforge.net/projects/afpfs-ng/
>
> "... a command-line tool that parses and prints the status information of an
> AFP server. It does this without having to login to a server. It is a
> response to the DSI GetStatus request (which is the same as the AFP
> FPGetSrvrInfo)"
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden