views:

72

answers:

1

Hey guys,

I've had trouble finding simple guides/examples for basic sockets in Objective-C (using NSSocketPort with NSFileHandle or using CFSocket/CSNetwork). Can anyone recommend a guide or a useful example? I would appreciate this greatly! I have tried to use this, but it is incomplete. Thanks!

P.S. I have been stuck in this part of my project for awhile and am starting to get desperate for some help.

A: 

The easiest way I've found to do this is the Cocoa Async Socket class:

http://code.google.com/p/cocoaasyncsocket/

It's pretty straight forward to use, there's good html documentation included.

JosephH
Is there anything else that you can recommend? All I want to do is send messages between two machines, where the sender knows the receivers IP Address.
hassaanm
Cocoa Async Socket is so simple and comprehensive I've never needed to look elsewhere to be honest. There are various examples on Apple's website, for example: http://developer.apple.com/mac/library/samplecode/UDPEcho/Introduction/Intro.html
JosephH