broadcast address #9

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@osbornebrook

there maybe a better way of doing this, but I have added the socket option Socket::SO_BROADCAST to allow for broadcast growls

@drbrain
Owner
drbrain commented Apr 13, 2012

Not every subnet is going to end on 255. Why not detect 255.255.255.255 instead?

@osbornebrook

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!)

@drbrain
Owner
drbrain commented Apr 13, 2012

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 19.0.2.255 and UDP

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).

@brandon-dacrib

Was this ever implemented in stable?

@drbrain drbrain added a commit that referenced this pull request Feb 14, 2014
@drbrain Extract #socket from Growl::UDP
This will allow for easy testing changes needed to implement #9
d2a724a
@drbrain drbrain added a commit that referenced this pull request Feb 14, 2014
@drbrain Set SO_BROADCAST for UDP broadcast addresses
This allows us to broadcast a UDP notification.

See #9
7ef903b
@drbrain
Owner
drbrain commented Feb 14, 2014

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.

@drbrain drbrain closed this Feb 14, 2014
@drbrain drbrain added a commit that referenced this pull request Feb 14, 2014
@drbrain Add #9 to History d4f0105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment