Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS And AsyncUDPSocket - Tutorial?

Tags:

ios

udp

arduino

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?

like image 651
djsegler Avatar asked Aug 04 '11 00:08

djsegler


1 Answers

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.
like image 178
fulvio Avatar answered Nov 14 '22 02:11

fulvio