You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been struggling with an issue for days now, without any success. The platform on which I'm trying to do this is iOS (using Swift). I have a GCDAsyncUdpSocket and configure it like this:
self.socket!.setIPv4Enabled(false)
self.socket!.setIPv6Enabled(true)
do {
try self.socket!.bindToPort(Announcement.ipv6BroadcastPort, interface: "en0")
}
catch let error {
print("bind failed: \(error)")
throw error
}
do {
try self.socket!.joinMulticastGroup("ff32::5222", onInterface: "en0")
}
catch let e {
print("join multicast failed: \(e)")
}
This calls both succeed. I verified that by stepping through the GCDAsyncUDPSocket code. After that, I try to send some data to a multicast address:
At that point, when stepping through the GCDAsyncUDPSocket code, I end up in a call to sendto in the method doSend (line 3919). This call returns -1 and the error is "no route to host". I'm running this in the iOS simulator. Just to provide a bit more detail: when I enumerate all available network interfaces, I get this:
Thanks @MeckiCologne. I have solved my issue, I succeeded in doing a send/receive over IPv6 UDP Multicast. The problem turned out to be a combination of issues. The posts that you mentioned were definitely relevant, I had also found them earlier and indeed setting the socket option IPV6_MULTICAST_IF turned out to be necessary for the sending to work. (Receiving doesn't seem to require it.) I'm still working on cleaning things up and moving my proof of concept towards the code that I really want to have, but people interested can look here: https://source.ind.ie/project/pulse-swift/blob/28bd0f48e3d4fa99f6095321a89036863c3f7a83/pulse-swift/discovery/Greeter.swift.
Hi,
I've been struggling with an issue for days now, without any success. The platform on which I'm trying to do this is iOS (using Swift). I have a
GCDAsyncUdpSocket
and configure it like this:This calls both succeed. I verified that by stepping through the
GCDAsyncUDPSocket
code. After that, I try to send some data to a multicast address:At that point, when stepping through the
GCDAsyncUDPSocket
code, I end up in a call tosendto
in the methoddoSend
(line 3919). This call returns -1 and the error is "no route to host". I'm running this in the iOS simulator. Just to provide a bit more detail: when I enumerate all available network interfaces, I get this:Any help is much appreciated!
The text was updated successfully, but these errors were encountered: