Jules,
Any chance you could add support for sending UDP local broadcast packets (i.e. packets sent to 255.255.255.255) to the DatagramSocket class in the next version of JUCE? It is currently possible to receive these packets, but not to send them.
To add support for sending UDP broadcast packets:
The expression starting on line 98 of juce_Socket.cpp:
return setsockopt (handle, SOL_SOCKET, SO_RCVBUF, (const char*) &rcvBufSize, sizeof (int)) == 0
&& setsockopt (handle, SOL_SOCKET, SO_SNDBUF, (const char*) &sndBufSize, sizeof (int)) == 0
&& (isDatagram || (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (int)) == 0));
…should be changed to:
return setsockopt (handle, SOL_SOCKET, SO_RCVBUF, (const char*) &rcvBufSize, sizeof (int)) == 0
&& setsockopt (handle, SOL_SOCKET, SO_SNDBUF, (const char*) &sndBufSize, sizeof (int)) == 0
&& (isDatagram || (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (int)) == 0))
&& (!isDatagram || (setsockopt( handle, SOL_SOCKET, SO_BROADCAST, (const char*)&one, sizeof(int) ) == 0));
Many thanks for so generously providing such a fantastic library!