开发者

What is the equivalent to WinSock in the iPhone SDK?

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

What is t开发者_如何学编程he equivalent library that I can use from the iPhone SDK?


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.


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.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜