BSD Sockets don't behave in a iPhone 3G environment

前端 未结 1 1577
别那么骄傲
别那么骄傲 2020-12-29 17:23

I noticed that many times while developing for an iPhone 3G, BSD socket functions will simply fail. I also noticed at the time, the 3G antenna wasn\'t even ON, nor was ther

相关标签:
1条回答
  • 2020-12-29 17:48

    The CFStream Socket Additions are what Apple recommends you use instead of the direct BSD sockets. They specifically warn about using the BSD sockets here:

    Although BSD (POSIX) networking APIs are available in iPhone OS, you should avoid using them. If you communicate directly with sockets, certain networking capabilities of iPhone OS, such as VPN On Demand, do not work. Use the APIs provided in CFStream Socket Additions instead.

    Note that CFNetwork and the like aren't Objective-C, but straight C for almost everything.

    0 讨论(0)
提交回复
热议问题