Getting started communicating with AFP -- on the right track?
Getting started communicating with AFP -- on the right track?
- Subject: Getting started communicating with AFP -- on the right track?
- From: Jerry Krinock <email@hidden>
- Date: Sat, 4 Jul 2009 14:45:59 -0700
My mission: In a program, I know the IP address of an AppleShare
server and would like to find its name, i.e. the "Computer Name".
At the high level, it appears that I could do this by sending it the
AFP command FPGetSrvrInfo.
I'm looking at the book "Advanced Mac OS X Programming" 2nd ed. by
Dalrymple and Hillegass. On page 303 they describe how to code a
client:
1. Get address info
2. Contruct a struct sockaddr_in
3. Get a socket()
4. connect() to the server
5. Use read() and write() to receive and send data.
They show sample code and this looks do-able. In step 5, I presume
I'm going to write() the FPGetSrvrInfo command which consists of two
bytes, kFPGetSrvrInfo=15, and a pad byte, in network byte order. And
then I'll read() from the server a packet that has its Server Name
starting after the Fixed Fields, at offset 0x0a.
Am I sort of on the right track? Is there a higher-level API I should
be using instead?
Sincerely,
Jerry Krinock
_______________________________________________
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