开发者

IOS And AsyncUDPSocket - Tutorial?

开发者 https://www.devze.com 2023-03-25 07:45 出处:网络
I am learning C and Objective-C so am still dependent on examples... I found AsyncUDPSocket which has a lot of example code in the Google Code repository, but I\'m not far enough along to understand

I am learning C and Objective-C so am still dependent on examples...

I found AsyncUDPSocket which has a lot of example code in the Google Code repository, but I'm not far enough along to understand it all yet. I'm trying to build an iPhone app that uses UDP for communication to another device (Arduino). I have the device end working (testing with the UDP Tool app). I just need help with the iOS side of it...

An example with more 开发者_开发百科explanation would really help (that is, a tutorial)... Is there one or what would some example code with good comments be?


https://github.com/robbiehanson/CocoaAsyncSocket

GCDAsyncUdpSocket and AsyncUdpSocket are UDP/IP socket networking libraries. Here are the key features available in both:

  • Native objective-c, fully self-contained in one class. No need to muck around with low-level sockets. This class handles everything for you.
  • Full delegate support. Errors, send completions, receive completions, and disconnections all result in a call to your delegate method.
  • Queued non-blocking send and receive operations, with optional timeouts. You tell it what to send or receive, and it handles everything for you. Queueing, buffering, waiting and checking errno - all handled for you automatically.
  • Support for IPv4 and IPv6. Automatically send/recv using IPv4 and/or IPv6. No more worrying about multiple sockets.
0

精彩评论

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

关注公众号