Closed congyuguo closed 6 years ago
Hmm not quite sure. Possibly you could enable it using a C function and the socket descriptor?
bcast_sock = socket(AF_INET, SOCK_DGRAM, 0);
int broadcastEnable=1;
int ret=setsockopt(bcast_sock, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable));
You can access the descriptor with socket.descriptor.raw
When I send message to 192.18.1.255, I get this error: Error Socket failed with code 13 ("Permission denied") [sendFailedToSendAllBytes]. I believe it's because UDP broadcast is disabled by default, so how can I enable it ?