udp-discovery icon indicating copy to clipboard operation
udp-discovery copied to clipboard

Get IP address of reply or broadcaster.

Open fusionstream opened this issue 5 years ago • 2 comments

Would be cool if we could get an IP address of the reply packet. Or indeed, the initial broadcaster. This is to facilitate easier creation of communications since we may not be assured on which interface an announcement or a reply(event) may have come from.

fusionstream avatar Jan 21 '20 13:01 fusionstream

Could you give me an example of how you would like it to look in the interface? Sounds like a good idea. I don't want to implement it and then have it not be what you want. You're welcome to do a PR, as well. I think this code needs some updating.

stdarg avatar Jan 21 '20 16:01 stdarg

A 4th argument for discovery.on('available', (name, data, reason, NETWORK) => {}); and a 3rd for discovery.on('MessageBus', (evt, res, NETWORK) => {}); would suffice where NETWORK would be an object populated with the appropriate details.

Have no real preference though if you have a better way? The above shouldn't break anything though.

There are a few other niggling issues but nothing I can't work around (especially without having to modify the module directly). May take up your offer on the PR if I can find the time! :D

fusionstream avatar Jan 26 '20 13:01 fusionstream