Reputation: 8719
I am working on a Chrome implementation of an existing networking library built on top of UDP multicast. Clients who wish to speak to each other bind to the same multicast address and port. To avoid address conflicts, library implementations set the "Reuse Address" option on sockets as they're created. The Java implementation, for instance, includes something that looks like this:
...
MulticastSocket socket = new MulticastSocket(port);
socket.setReuseAddress(true);
socket.joinGroup(address);
...
Unfortunately there doesn't seem to be an equivalent option in the chrome.sockets.udp
API. That means that if I'm running the networking library in another process on my local machine (a relatively common use case) I get an error when trying to bind the socket in my Chrome application. The callback from chrome.sockets.udp.bind
gives me an error code of -147
.
I took a brief look at Native Client but found some information suggesting that it doesn't yet support UDP multicast.
Is there any way to reuse a UDP multicast address from within a Chrome application? Or might that functionality be offered by another browser?
Upvotes: 3
Views: 715
Reputation: 77523
I'm afraid that for Chrome it's a known feature request that was assigned but shows no progress for half a year. As of now, there is indeed no equivalent option in the API.
You could bypass all that with a Native Messaging Host, but depending on how you want to deploy your app/extension it may be prohibitively clunky.
This may be a related (and also unfinished) feature request for Firefox.
Upvotes: 5