Poller refactoring, replace Timer with ScheduledExecutorService
* Replace Timer with ScheduledExecutorService (closes#258)
* Move automatic connection logic from PluginManager to Poller
* Reschedule polling when connections are opened or closed, making the poller more responsive to reductions in the polling interval
See merge request !180
Try harder to connect to contacts
* When an outgoing connection is lost, try to reconnect to the contact straight away
* Use periodic polling for Tor, regardless of whether our hidden service descriptor has been published
* Reduce polling intervals for all plugins (this can be reverted if we solve the connectivity issues)
Closes#262, #314. Hopefully helps with #361.
See merge request !177
When more than one invitation socket is opened, Alice should pick which one to use and Bob should use whichever one Alice picks. This fixes a race condition where each party picked a different socket and closed the other.
The polling interval increases exponentially each time polling is unsuccessful, up to a maximum of 60 minutes. The interval is reset to 2 minutes whenever a connection is made and whenever Bluetooth is re-enabled.
DuplexOutgoingSession flushes its output stream if it's idle for a
transport-defined interval, causing an empty frame to be sent. The TCP
and Tor plugins use a socket timeout equal to twice the idle interval to
detect dead connections.
See bugs #27, #46 and #60.
The LAN plugin only accepts IPv4 link-local or site-local addresses.
This rules out LANs that use globally routable addresses (such as UCL),
but also reduces the chances of the LAN plugin making observable
connections across the WAN, which could reveal the social graph.
Both plugins will attempt to reuse the previous address and port only if
there's currently an interface with that address; this will avoid
unnecessary attempts to bind to nonexistent addresses.