robbiehanson/CocoaAsyncSocket — Issue #18: Different behaviours in iOS simulator and device (iOS5)
Author: pjlsilva
Created: 2012-01-23 12:16:28+00:00
State: open

I' trying to user AsyncUdpSocket class to make a ssdp discovery run on my program.

I implemented everything to send and read from port 1900, address 239.255.255.250.

In the simulator, everything is 100%. The exact same code, in a device, does not receive a thing. The device sends the package and I see the packets of the response in the network with wireshark but the device just ignores them.

Is there some sort of knonw issue with iOS5 or similar?

the code i use is as follows:

AsyncUdpSocket *ssdpSocket = [[AsyncUdpSocket alloc] initIPv4];
[ssdpSocket setDelegate:self];

[ssdpSocket enableBroadcast:YES error:nil];

[ssdpSocket bindToPort:1900 error:nil];

[ssdpSocket joinMulticastGroup:@"239.255.255.250" error:&error];

[ssdpSocket receiveWithTimeout:-1 tag:1];

[ssdpSocket sendData:[self somedata] toHost:@"239.255.255.250" port:1900 withTimeout:-1 tag:1];