Creating a socket client in Objective-C - Mac OSX

I need to basically send some “data” in 98.136.86.109 to port 587. How can I do this in obj-c in my mac application?

+3
source share
2 answers

As Jan points out in his answer, you can use standard network APIs such as BSD, such as socket(), connect()etc. However, if you want to stay in Objective-C and Foundation, then you are looking for NSInputStreamand NSOutputStreamwhich are the flow classes for Cocoa. However, you should not look at it NSSocketPortas being specifically designed to use distributed objects.

Apple " Cocoa" : http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Streams/Streams.html

, , , NSStream .

+5

, AsyncSocket - , CFSocket CFStream, API Objective-C TCP UDP (AsyncUdpSocket).

+2

All Articles