Looking at the Resource.py example that comes with Reticulum, I had the naive conception that, when I run the server, it would sit there quietly without announcing itself until I announce it manually.
My conception turns out to be wrong. When I run the server, it happily announces itself as soon as it is created. No need to hit enter to manually send an announce.
When we create a RNS.Destination, RNS.Transport.register_destination is called which automatically announces every "single" destination.
This behavior is most likely intended and needed (better be carefully here as I owe Mark to beers already ;).
Question:
Wouldn't it be nice if we could create a server that only reveals itself when we actually decide to reveal it with a manual announce or via a config setting like announce_enabled = true?
Examples directory
$ python Resource.py --server
Examples/Resource.py line 38, RNS 1.5.0
server_destination = RNS.Destination(
server_identity,
RNS.Destination.IN,
RNS.Destination.SINGLE,
APP_NAME,
"resourceexample"
)
RNS.Transport.py line 2847, RNS 1.5.0
if Transport.owner.is_connected_to_shared_instance:
if destination.type == RNS.Destination.SINGLE:
def job():
time.sleep(0.25)
destination.announce(path_response=True)
threading.Thread(target=job, daemon=True).start()