Re: Peer To Peer Design
Re: Peer To Peer Design
- Subject: Re: Peer To Peer Design
- From: Jaime Magiera <email@hidden>
- Date: Mon, 27 Jan 2003 02:43:40 -0500
Sorry, didn't mean to be so oblique :) Do you have any experience in
network programming? I didn't really know much in the way of Cocoa
networking until a few months ago. (all of my previous experience was
with WO and Frontier). Start by getting the BSD Network Programming
book by Stephens. You'll most likely be mixing BSD socket code with
CFNetwork/CFSocket (the Core Foundation Networking API). then...
* Decide on a data transfer format: Obviously, it will have to be
something that can work over a network and can be coded/decoded
relatively quickly. I chose SOAP. Though it's not the most secure, it's
an easily parsed standard that would allow other developers to write
compatible applications. It works well in the P2P environment.
* Design a Server to receive incoming messages: You'll register a
socket in a CFRunLoop. Check the list archives for examples. This will
form the basis for the app to receive messages.
* Design a Sender: You'll want to create a class that will convert your
application data (NSString, NSArray, etc.) into the network data
format, send it out to other apps (on a mutually agreed upon port) and
return the result. In my case, the new Web Services API in the OS 10.2
takes care of converting an NSDictionary to a SOAP call.
* Design a method of discovery: There has to be some way for clients to
know about each other. I chose to go both true P2P and also use a
"router". Basically, the desktop app allows the user to enter in IP
addresses for other clients, as well as the ability to register/query a
Web Objects server that tracks connected clients. In the long run, I'll
be using service discovery API.
That's a quick overview. Fire away with any specific questions. I'm
still a newbie in the world of Cocoa, but my little app seems to work.
Jaime
On Sunday, January 26, 2003, at 10:12 PM, Roarke Lynch wrote:
It might not be that difficult, but I'm looking for the place to
start. I understand the basic concept, but have no idea on the
implimentation. I've read a bit of code on simple c sprockets and all
but I have a feeling that there is more to the design of a scalable
and secure peer to peer relation. Got any pointers?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.