Enabling unlimitted scanning by setting TimeLimit to a negative value and setting Notify to a function, consuming a Discovered struct, will let the peerdiscovery library run forever. Each discovery, regardless of wether known before or not, will be passed to the Notify function. This implementation is oriented by the observer pattern.
I needed the described change of the library for my use case. This enables scanning for new peers in the background and letting me decide if I want to establish a connection to those hosts.
Please give me a feedback, if this is helpful for you or this library at all?
Enabling unlimitted scanning by setting
TimeLimit
to a negative value and settingNotify
to a function, consuming aDiscovered
struct, will let thepeerdiscovery
library run forever. Each discovery, regardless of wether known before or not, will be passed to theNotify
function. This implementation is oriented by the observer pattern.I needed the described change of the library for my use case. This enables scanning for new peers in the background and letting me decide if I want to establish a connection to those hosts.
Please give me a feedback, if this is helpful for you or this library at all?