objective-c - UDP多个实例同时发送请求,只能收到一个或两个响应
阿神
阿神 2017-04-24 09:10:26
[iOS讨论组]

iOS项目中使用GCDAsyncUdpSocket进行udp通讯,但是在并发的情况下,同时发送6个请求,每次只能收到一个或两个响应,下面是输出的日志信息,不明白为什么总是只能收到一个请求的响应

2014-09-11 16:30:13.624 UDPConcurrent[2553:60b] self is <GCDAsyncUdpSocket: 0x15d5bb60> gcd send to 192.168.0.143 port is 56797 and data is <000633ad 3568>
2014-09-11 16:30:13.629 UDPConcurrent[2553:60b] self is <GCDAsyncUdpSocket: 0x15d5d570> gcd send to 192.168.0.143 port is 56797 and data is <00065dad 1908>
2014-09-11 16:30:13.634 UDPConcurrent[2553:60b] self is <GCDAsyncUdpSocket: 0x15e6f4b0> gcd send to 192.168.0.143 port is 56797 and data is <000717ad 012820>
2014-09-11 16:30:13.635 UDPConcurrent[2553:60b] self is <GCDAsyncUdpSocket: 0x15d5e860> gcd send to 192.168.0.143 port is 56797 and data is <000717ad 026821>
2014-09-11 16:30:13.638 UDPConcurrent[2553:60b] self is <GCDAsyncUdpSocket: 0x15e6fb70> gcd send to 192.168.0.143 port is 56797 and data is <000753ad 016835>
2014-09-11 16:30:13.640 UDPConcurrent[2553:60b] self is <GCDAsyncUdpSocket: 0x15d5ef20> gcd send to 192.168.0.143 port is 56797 and data is <000753ad 022834>
2014-09-11 16:30:13.643 UDPConcurrent[2553:60b] self.request1 is <GCDAsyncUdpSocket: 0x15d5bb60>
2014-09-11 16:30:13.645 UDPConcurrent[2553:60b] self.request2 is <GCDAsyncUdpSocket: 0x15d5d570>
2014-09-11 16:30:13.647 UDPConcurrent[2553:60b] self.request3 is <GCDAsyncUdpSocket: 0x15e6f4b0>
2014-09-11 16:30:13.649 UDPConcurrent[2553:60b] self.request4 is <GCDAsyncUdpSocket: 0x15d5e860>
2014-09-11 16:30:13.650 UDPConcurrent[2553:60b] self.request5 is <GCDAsyncUdpSocket: 0x15e6fb70>
2014-09-11 16:30:13.652 UDPConcurrent[2553:60b] self.request6 is <GCDAsyncUdpSocket: 0x15d5ef20>
2014-09-11 16:30:13.670 UDPConcurrent[2553:60b] socket is <GCDAsyncUdpSocket: 0x15d5bb60> port is 49172 and tag is 1
2014-09-11 16:30:13.672 UDPConcurrent[2553:60b] socket is <GCDAsyncUdpSocket: 0x15d5d570> port is 54971 and tag is 2
2014-09-11 16:30:13.674 UDPConcurrent[2553:60b] socket is <GCDAsyncUdpSocket: 0x15e6f4b0> port is 55715 and tag is 3
2014-09-11 16:30:13.676 UDPConcurrent[2553:60b] socket is <GCDAsyncUdpSocket: 0x15d5e860> port is 51186 and tag is 4
2014-09-11 16:30:13.678 UDPConcurrent[2553:60b] socket is <GCDAsyncUdpSocket: 0x15e6fb70> port is 53467 and tag is 5
2014-09-11 16:30:13.680 UDPConcurrent[2553:60b] socket is <GCDAsyncUdpSocket: 0x15d5ef20> port is 64005 and tag is 6
2014-09-11 16:30:13.686 UDPConcurrent[2553:60b] socket is <GCDAsyncUdpSocket: 0x15d5ef20> port is 64005 and response data is <000f34da 00199437 a2720000 002b0f>
阿神
阿神

闭关修行中......

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号