Skip to content

Create poller for rendezvous connections

akwizgran requested to merge 1567-rendezvous-poller into master

This branch adds a poller for rendezvous connections. The poller manages a rendezvous endpoint for each pair of a pending contact and an enabled transport. The endpoint is closed when the transport is disabled or the pending contact expires or is removed. Endpoints are created by plugins that support rendezvous, which in the first iteration will only be the Tor plugin.

The poller listens for PendingContactAdded/RemovedEvents and TransportEnabled/DisabledEvents, and broadcasts a RendezvousFailedEvent when a pending contact expires.

The polling interval is 1 minute. Once we've tested this we may want to implement some kind of backoff - for example, increasing each endpoint's interval by 1 minute for each hour the endpoint has been open, up to a maximum of 10 minutes. However, I plan to keep the intervals aligned to multiples of 1 minute so we can use a single periodic task, which should make power management easier.

Newly added pending contacts are polled immediately, which should allow us to make a quick connection even if the local and remote devices have both recently polled and therefore won't make another periodic poll for nearly a full interval.

Closes #1567 (closed)

Merge request reports