Hello.
I am trying to port one of my existing applications (https://github.com/techflashYT/mtocptwm) to the Nintendo Switch.
This application currently only sends and receives packets on the multicast address.
I was able to get all of the Switch specific initialization stuff working, and transmitting packets works, however it has a really weird issue when trying to recieve them.
When calling `setsockopt()`, it gives me an error:
The related block of code from my project:
Note that I am using a custom implementation of `perror()`, since it doesn't seem to do anything in here.
I honestly have no idea what's wrong here. It works perfectly fine on both Windows and Linux.
Does anyone know what's wrong with this, and if there's anything I can do about it?
I am trying to port one of my existing applications (https://github.com/techflashYT/mtocptwm) to the Nintendo Switch.
This application currently only sends and receives packets on the multicast address.
I was able to get all of the Switch specific initialization stuff working, and transmitting packets works, however it has a really weird issue when trying to recieve them.
When calling `setsockopt()`, it gives me an error:
Code:
setsockopt mreq: Not owner
return value: -1
The related block of code from my project:
C:
struct ip_mreq mreq;
mreq.imr_multiaddr.s_addr = inet_addr(netInfo.multicastIP);
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
ret = setsockopt(netInfo.socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));
if (ret < 0) {
perror("setsockopt mreq");
printf("\r\nreturn value: %d\r\n", ret);
platformExit(true);
}
Note that I am using a custom implementation of `perror()`, since it doesn't seem to do anything in here.
I honestly have no idea what's wrong here. It works perfectly fine on both Windows and Linux.
Does anyone know what's wrong with this, and if there's anything I can do about it?






