PDA

View Full Version : Network Programming


henryj
2002.12.31, 11:21 PM
What's the recommended networking api on OSX? Cocoa excluded, I've looked at OpenTransport and CFNetwork and the docs are appalling for both. What is everyone else using?

Patrick
2002.12.31, 11:49 PM
I used Open Transport when I had to use networking. Apple's Carbon documentation for it is HORRIBLE, but you can still get Inside Macintosh: Open Transport from the Classic section. Quite a good book but only covers up to Open Transport 1.3.
Inside Macintosh: Open Transport, the O.T. technotes and looking up stuff on XTI ( what Open Transport was based on ) managed to do the trick for me :)

~~

You could also just try using BSD Sockets itself. From what I understand, they have somewhat better performance than Open Transport( which on OS X is just a wrapper on top of BSD Sockets )
check here for a page on BSD Sockets : http://www.ecst.csuchico.edu/~beej/guide/net/html/

Mark Levin
2003.01.01, 01:31 AM
And since the BSD socket API is cross-platform and has been around for decades, there are way more tutorials and open-source specialty wrappers and so on for them than for pretty much everything else.

OneSadCookie
2003.01.01, 03:01 AM
Just go with sockets; your code will be more portable and the docs are good :)

It's not really all that hard, either.

The best tutorial I've seen: http://www.ecst.csuchico.edu/~beej/guide/net/

henryj
2003.01.01, 05:11 AM
I've done sockets before. I was hoping to find 'the one true OS X way' but I'm not having any luck. CFNetwork seems to be a wrapper for sockets but there are NO docs at all.

The ideal would be a class library that works just like Java's networking stuff. I've just spent the last 2 hours playing with Java and I have a working newsgroup reader. It's just a shame java still looks ugly on OS X.

Hog
2003.01.01, 02:37 PM
maybe you might want to try using distributed objects http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/DistrObjects/index.html

hyperzoanoid
2003.01.05, 03:23 PM
have you heard of rendevous? it goes really well with sockets.

henryj
2003.01.05, 03:57 PM
I used Java in the end. Way easier. Apple should ditch Cocoa and concentrate on Java.

KittyMac
2003.01.06, 06:24 PM
Originally posted by henryj
I've done sockets before. I was hoping to find 'the one true OS X way' but I'm not having any luck. CFNetwork seems to be a wrapper for sockets but there are NO docs at all.

"The one true" Mac OS X way (excluding Cocoa) is to use CFNetwork. I would suggest these over sockets, especially if you want to tap into things like Rendezvous. But if you don't need the extras, just use sockets (that's what I do :) )

Cheers,
Rocco

henryj
2003.01.06, 09:42 PM
"The one true" Mac OS X way (excluding Cocoa) is to use CFNetwork.

That's what I was going to use but I couldn't find any docs.