通过GCDAsyncUdpSocket发送多播UDP失败,Wireshark中没有活动 [英] Sending Multicast UDP by GCDAsyncUdpSocket fails, no activity in Wireshark

查看:242
本文介绍了通过GCDAsyncUdpSocket发送多播UDP失败,Wireshark中没有活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于这样的任何已知IP都可以正常工作:

It works okay for any known IP like this:

[udpSocket sendData:datatosend toHost:@"192.168.1.113" port:port withTimeout:-1 tag:0];

但是当我尝试使用宽带多播时,什么也没记录,什么也没发生

But when i'm trying to use broadband multicast, nothing logged and nothing goes on

[udpSocket sendData:datatosend toHost:@"192.168.1.255" port:port withTimeout:-1 tag:0];

接收工作正常,我也尝试了255.255.255.255-相同. 它没有任何错误.

receiving works okay, i also tried 255.255.255.255 - the same. it doesn't give any error.

推荐答案

我找到了解决方法:

[udpSocket enableBroadcast:YES error:nil]; 

这篇关于通过GCDAsyncUdpSocket发送多播UDP失败,Wireshark中没有活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆