问题
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