Archive for October 10th, 2008

This one has to be listed (more honestly) under the title “Networking on a Mac (which includes iPhone)”. But this is a seriously worthwhile read. There are several projects we are looking at that may need this kind of communication.

Cocoa for Scientists (Part XXVIII): Bonjour and How Do You Do? | MacResearch

Cocoa for Scientists (Part XXVIII): Bonjour and How Do You Do?
By drewmccormack at Tue, Oct 7 2008 3:45am |

* Tutorials

Author: Drew McCormack
Web Sites: macflashcards.com, macanics.net

Many of you will have noticed that last week Apple lifted their NDA on the iPhone SDK, which means we are now free to talk about it. You will undoubtedly read a lot about what is in the SDK, on blogs, and in Apple’s own documentation, but one aspect of iPhone development that I found to be poorly covered was networking. I don’t mean downloading a web page, or copying files from an FTP server, I mean the low-level stuff. How do you find and talk to another iPhone or Mac? The options available on the iPhone are also available on the Mac, so it seemed like a good topic for this series.
Low-Level Networking

One of the reasons you won’t find too many articles about low-level networking in Cocoa is two-fold:

1. There are good high-level networking options — on the Mac.
2. Low-level networking is quite hard.

The Mac has a technology called ‘Distributed Objects’ (DO), which makes it quite easy for one process to talk to another, even if it is on another computer. The downside of DO is that it works only on Macs, not on iPhones, and not on any other platform. If you want to communicate iPhone-to-iPhone, Mac-to-iPhone, iPhone-to-PlatformX, or Mac-to-PlatformX, you will need something more low-level.

This brings us to point (2): low-level networking can be a little tricky, which means you will probably want to build your own ‘Messaging Library’, to reduce the complexity and chance of bugs. This is a set of functions and classes that allow you to easily send messages — chunks of data — from one system to another, without having to think too much about it.

Comments Comments Off