views:

135

answers:

2

I need to communicate with a hardware device using TCP and with Windows I would use WinSock.

What is the equivalent library that I can use from the iPhone SDK?

+2  A: 

There isn't anything like winsock per-se, there is Objective-C wrappers around POSIX Sockets, like NSUrl and the like. This (Network Programming - iPhone SDK) might help with getting an idea about what is available.

fuzzy lollipop
+1  A: 

WinSock is Window's version of the BSD socket. iPhoneOS being Darwin having a BSD user-land of course has a socket API (<sys/socket.h> etc) too.

See http://en.wikipedia.org/wiki/Berkeley_sockets.

In CoreFoundation there is also a higher level API called CFSocket. (The Foundation version, NSSocketPort, is not available on iPhoneOS.)

KennyTM