Sending Multicast UDP by GCDAsyncUdpSocket fails, no activity in Wireshark

眉间皱痕 提交于 2019-12-11 08:11:23

问题


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];

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


回答1:


I found the solution:

[udpSocket enableBroadcast:YES error:nil]; 


来源:https://stackoverflow.com/questions/9728285/sending-multicast-udp-by-gcdasyncudpsocket-fails-no-activity-in-wireshark

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!