Anthony,

If the destination udp port is configurable, how will the app know what 
UDP port to listen to? This could becomes an annoyance for those 
non-technical users. This means that, even if you make it configurable, 
you cannot change it easily and the server and the app must define the 
same default values.

If the http server port is different from the UDP port, then the UDP 
packet should indicate the http server port. Otherwise, how will the app 
know what port number to use for the http requests?

For example:

    "sprinkler 8080" (generated from: 'sprinkler '+config.webserver.port)

(BTW, the TCP and UDP port spaces are separate: you can use the same 
port number for HTTP and UDP at the same time.)

Pascal.

On 10/26/2013 09:03 AM, Anthony Webb wrote:
>
> In server.js:
>
> >  @@ -211,13 +233,16 @@ setInterval(function(){
> >   // Start auto discovery UDP broadcast ping
> >   var message = new Buffer("sprinkler");
> >   var socket = dgram.createSocket("udp4");
> >  -socket.bind();
> >  -socket.setBroadcast(true);
> >  +// TBD: better use callback: socket.bind(config.webserver.port, function() {
> >  +socket.bind(config.webserver.port);
>
> lets use some other port than the webserver port, for the broadcast 
> port (on line 243 we hard coded this to 41234) should be specified in 
> the config
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/anthonywebb/sprinkler/pull/4/files#r7234181>.
>