PDA

View Full Version : Sockets tutorial


tricolaire
07-02-2005, 12:41 AM
I code a lot in Java, in which the sockets are comparatively easy, but situations arise quite often when I have to do c++

Since I code on mac, and a good deal of these situations require sockets, I need some help. My c++ books all site example of sockets ON WINDOWS

can anyone point me to a good mac sockets tutorial

I know someone's gonna point this out, so I may as well preempt, YES, I HAVE ALREADY TRIED WEB SEARCHES!!

thanx for any help

aman
07-02-2005, 07:16 AM
Mac is tough because only recently have you been able to use Berkley Sockets. This is new since macintosh finally advanced into this century with OSX and Mach-O. That along with the fact that mac coding tutorials are hard to find anyway makes it tough to get examples.

I think it depends on your target audience what you need to use. If you only want to target OSX and up systems then you can use standard Berkley Sockets tutorials and code compiled with X-Code or gcc.

If you want to target older macs as well, then you'll need to download the OT libs and learn how to do network coding with Apple's OpenTransport API.

OT isn't that hard to learn, and in some ways is quite similar to standard sockets, and there are a few OT examples (although a bit dated) on the Apple Developer site.

suryad
07-03-2005, 09:19 AM
tricolaire when you say you code on a mac...you are still coding in Java right? Why dont you use the Java implementation of sockets...? Would that work for you and for what you are trying to do?