IOS 和 AsyncUDPSocket - 教程?
我正在学习 C 和 Objective-C,所以仍然依赖于示例...
我发现 AsyncUDPSocket 在 Google 代码存储库中有很多示例代码,但我还没有完全理解它。 我正在尝试构建一个使用 UDP 与另一个设备(Arduino)进行通信的 iPhone 应用程序。我的设备端正在工作(使用 UDP 工具应用程序进行测试)。我只需要 iOS 方面的帮助...
带有更多解释的示例确实会有所帮助(即教程)...是否有一个或一些带有良好注释的示例代码是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https://github.com/robbiehanson/CocoaAsyncSocket
GCDAsyncUdpSocket
和AsyncUdpSocket
是 UDP/IP 套接字网络库。以下是两者的主要功能:用低级套接字搞乱。这个类处理一切
你。
错误、发送完成、接收完成和断开连接都会导致调用您的委托方法。
超时。
您告诉它要发送或接收什么,它会为您处理一切。排队、缓冲、等待和检查 errno - 全部
自动为您处理。
使用 IPv4 和/或 IPv6 自动发送/接收。不再担心多个套接字。
https://github.com/robbiehanson/CocoaAsyncSocket
GCDAsyncUdpSocket
andAsyncUdpSocket
are UDP/IP socket networking libraries. Here are the key features available in both:muck around with low-level sockets. This class handles everything for
you.
Errors, send completions, receive completions, and disconnections all result in a call to your delegate method.
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.
Automatically send/recv using IPv4 and/or IPv6. No more worrying about multiple sockets.