iosios7udpudpclientcfsocket

How to send a string in a UDP socket in iOS7?


I am trying to send a simple string over UDP in my iOS7 app to a known IP and could not find a simple explanation and sample code on how to do that. There is plenty out there about TCP but not so much about UDP and it has to be UDP in my case.


Solution

  • You could use https://github.com/robbiehanson/CocoaAsyncSocket, which is an Objective-C wrapper for TCP and UDP connections. It also contains sample code for TCP and UPD clients and servers.