Re: AppleTalk to Carbon networking transition advice?
Re: AppleTalk to Carbon networking transition advice?
- Subject: Re: AppleTalk to Carbon networking transition advice?
- From: David Sinclair <email@hidden>
- Date: Wed, 1 Feb 2006 17:00:33 -0800
On Feb 1, 2006, at 13:00, Frederick Cheung wrote:
This project is a Classic one being Carbonized (yes, years
late!). We were originally going to upgrade to Open Transport, to
maintain Mac OS 9 compatibility, but are now thinking about
dropping that and using CFNetwork or similar modern API. The apps
use Carbon Events (but presumably I'd be able to call
GetCFRunLoopFromEventLoop() to access the CFRunLoop, if needed).
OpenTransport is going the way of the dodo. I certainly wouldn't
get tied up with that kind of stuff.
Indeed. The only reason for considering it was to maintain Mac OS 9
compatibility, since being networked apps, the customers could have a
mix of older and newer machines. But our current feeling is that Mac
OS X has been out for about 5 years now, so requiring that they use
computers introduced in the last 5 years isn't too unreasonable.
Bonjour is about discovering services on the network, ie finding
addresses. Typically you tell NSNetService or CFNetservice that you
want a certain type of service and it will call your callback when
it finds one. You then ask for it to be resolved and typically
you'll get back IPV6 or IPv4 addresses and port numbers.
However you could of course have obtained that data from elsewhere
(configuration file, the user, etc...), and you could connect to
the machine from anywhere (modulo firewalls, routers etc...). The
bonjour side is also separate from whether you want to use TCP or UDP
Yes, Bonjour would be a separate part of the solution. I just
mentioned it in case it helped people point me to useful sample code,
or understand what I am implementing.
Apart from the AppleTalk experience, I've also used NSStream in
Cocoa, and CFStream in Carbon, but I wouldn't call myself an
expert by any stretch, so I'd appreciate any advice you can provide.
I'd say NSStream/CFStream would be a good place to start, i've used
them for similar purposes. CFStreams give you some things pretty
much for free, eg SSL support, SOCKS proxies etc... You also get
all the integration into the runloop.
CFSocket integrates a socket into the runloop, so if you want to
use sockets directly that would probably be your first port of call.
Sounds good. Thank you; I'm glad I'm heading in the right direction.
So, is there any sample code of using CFStream to implement a server
and client? Or is it basically the same as connecting to an internet
server? Perhaps I only need an example of the server side: handling
connection requests from multiple clients and such.
--
David Sinclair, Dejal Systems, LLC - email@hidden
Custom Mac OS X development - http://www.dejal.com/consulting/
Site change and failure monitor tool - http://www.dejal.com/simon/
Plus other useful Mac products - http://www.dejal.com/
_______________________________________________
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