Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

UDP socket not receiving multicast #32

Open
SindujaPrakash opened this issue Jan 22, 2021 · 0 comments
Open

UDP socket not receiving multicast #32

SindujaPrakash opened this issue Jan 22, 2021 · 0 comments

Comments

@SindujaPrakash
Copy link

I am using the plugin for UDP multicast.

This is my code,

chrome.sockets.udp.create({ bufferSize: MAX_MSG_LENGTH }, function(createInfo) //Create socket entry
{
self.serverSocket = createInfo.socketId;
chrome.sockets.udp.setBroadcast(self.serverSocket, true, function(result) {
if (result < 0) {
console.log("setBroadcast failed");
}
});
chrome.sockets.udp.setMulticastTimeToLive(self.serverSocket, TTL, function(result) {
if (result < 0) {
console.log("MULTICAST FAILED" + result);
} else {
chrome.sockets.udp.bind(self.serverSocket, "0.0.0.0", MCAST_PORT, function(result) {
if (result < 0) {
console.log("BIND FAILED" + result);
chrome.sockets.udp.close(self.serverSocket);
} else {
chrome.sockets.udp.joinGroup(self.serverSocket, MCAST_IP_ADDR, function(result) {
if (result < 0) {
console.log("Couldn't join Group!");
chrome.sockets.udp.close(self.serverSocket);
} else {
chrome.sockets.udp.onReceive.addListener(function(msg) {
console.log(msg.socketId);
}
}
};

I have set Android Permissions




I use cordova 10.0.0 and Framework7 for developing the hybrid app.

I receive a message from my local browser on the UDP.onReceive.addEventListener, but not from the other devices.

Could you help me if I am missing something? Should I add any more permissions?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant