there maybe a better way of doing this, but I have added the socket option Socket::SO_BROADCAST to allow for broadcast growls
set socket option to allow broadcast if using broadcast address
Not every subnet is going to end on 255. Why not detect 255.255.255.255 instead?
In a mutli-homed host I wanted to have the option of broadcasting to a single network (i.e. 192.168.x.255) and not to the whole world on the public interface. An alternative might be that we use another option ( "-b" ) to indicate that we want to broadcast and if the host is not specified (so I don't explicitly set my network) then it uses 255.255.255.255. What do you think ? (I would be happy to update the code!)
I think your idea is good. Just to make sure, --broadcast would force the growl_type argument of #initialize to 'UDP' and the --host would be optional.
So with a network of 192.0.2.0/24:
growl --broadcast uses 255.255.255.255 and UDP
growl --broadcast --host 192.0.2.255 uses 22.214.171.124 and UDP
growl --broadcast --host 192.0.2.255
growl --host 192.0.2.255 uses 192.0.2.255 and auto-detects GNTP or UDP (even though this is not a valid host to connect to).
growl --host 192.0.2.255
Was this ever implemented in stable?
Extract #socket from Growl::UDP
This will allow for easy testing changes needed to implement #9
Set SO_BROADCAST for UDP broadcast addresses
This allows us to broadcast a UDP notification.
UDP broadcast does not work with modern growl. I've implemented UDP broadcast sending but it does nothing with growl 2.x. I can't get growl 1.x to work at all on OS X 10.9. I will ship the UDP broadcast code for API use only, maybe someone will find this useful.
Add #9 to History