Commit Graph

57 Commits

Author SHA1 Message Date
str4d 02ed01ead8 Add BQP support to LanTcpPlugin 2016-05-12 02:49:34 +00:00
akwizgran 3680cad9b8 Merge branch 'poller-refactoring' into 'master'
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
2016-05-11 14:45:50 +00:00
akwizgran 1bd5c0b195 Merge branch 'aggressive-polling' into 'master'
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
2016-05-10 14:47:04 +00:00
str4d 0dfc735288 Store a limited number of recent LAN IP addresses 2016-05-06 16:44:52 +01:00
akwizgran 57be439f08 Code cleanup and logging. 2016-05-06 12:11:40 +01:00
akwizgran e3bf20aed5 Reschedule polling when connections are opened or closed. 2016-05-06 12:11:40 +01:00
akwizgran 1bdd7ca761 Removed empty Poller interface. 2016-05-06 12:11:39 +01:00
akwizgran 5044f34ba9 Moved all automatic connection logic into poller. 2016-05-06 12:11:39 +01:00
akwizgran ff8301521c Replaced Timer with ScheduledExecutorService. #258 2016-05-06 12:11:34 +01:00
akwizgran 036c5d6753 No need to poll plugins before they're enabled. 2016-05-06 12:09:30 +01:00
akwizgran dd9bc74262 Try to reconnect on connection loss. #262 2016-05-06 12:07:56 +01:00
akwizgran befd916eba Connect to newly activated contacts. 2016-04-06 17:10:54 +01:00
akwizgran b480777548 Services should throw exceptions for startup errors. 2016-04-05 15:44:50 +01:00
akwizgran 9714713d73 Add transports to DB during startup. #269 2016-03-28 13:47:23 +01:00
akwizgran 0417639410 Merge duplex and simplex plugin config classes. 2016-03-28 11:28:46 +01:00
akwizgran 0ac67239e3 Fixed race condition when closing redundant sockets.
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.
2016-03-07 11:50:47 +00:00
akwizgran b8cf508b0c Moved ImmediateExecutor out of plugins package. 2016-02-26 14:16:09 +00:00
akwizgran 5ce8927477 New polling logic for LAN (and WAN). #252
Same exponential backoff approach as Bluetooth.
2016-02-22 13:25:07 +00:00
akwizgran c081c08ff5 New polling logic for Bluetooth. #251
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.
2016-02-22 13:21:05 +00:00
akwizgran e979f17e45 Execute test tasks in a deterministic order. 2016-02-17 17:24:43 +00:00
akwizgran de8cc50fb4 Moved transactions out of database component. 2016-02-11 16:26:19 +00:00
akwizgran 225d0ebeef DB interface cleanup, removed unnecessary exceptions. 2016-02-10 10:47:29 +00:00
akwizgran 88475bdd54 Transport properties client. #229 2016-01-27 12:51:55 +00:00
Santiago Torres 190bb12964 ENH: Replaces transport config with namespaced settings 2016-01-20 00:57:16 -05:00
akwizgran ec096e6750 Updated tests for jMock 2.8.1. 2016-01-18 12:47:11 +00:00
akwizgran 805bf39ec8 Created TransportPropertyManager facade. 2016-01-04 12:56:06 +00:00
akwizgran c5282c5b17 Moved some API classes into packages. 2015-12-17 16:56:57 +00:00
Torsten Grote 2d28dcada2 Create two new events to signal enabling and disabling of transports 2015-12-17 11:34:10 -02:00
akwizgran 912ba394c5 Refactored FileUtils.
Removed methods that are no longer needed for Java 6, moved the remaining method into the utils directory.
2015-12-10 15:58:52 +00:00
akwizgran 947da886bf Fixed broken tests. 2015-12-10 15:14:50 +00:00
Ernir Erlingsson a5fd7ff9dc Added dependency injections for FileUtils and removed redundant code 2015-12-10 11:07:10 +01:00
akwizgran 123dff3a3d Don't mix JUnit 4 annotations with JUnit3 TestCase. 2015-12-08 14:53:50 +00:00
akwizgran 027ae8340f Whitespace-only code formatting changes. 2015-11-30 09:38:25 +00:00
akwizgran 47bd84122e Code formatting and small cleanups. 2015-01-28 21:18:31 +00:00
akwizgran d3bf2d59a1 Use the same maximum frame length for all transports. 2015-01-05 16:24:44 +00:00
akwizgran 388b36b6be Check periodically for retransmittable packets. Bug #46. 2014-12-14 20:26:41 +00:00
akwizgran d4fa656dbb Application layer keepalives to detect dead TCP connections.
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.
2014-12-13 12:00:40 +00:00
akwizgran d94637b5cf Removed polling from ModemPlugin. 2014-12-05 12:46:11 +00:00
akwizgran 4009561996 Refactored PluginManager and Poller to remove non-open calls. Bug #15. 2014-11-08 15:40:51 +00:00
akwizgran c202b6f0ac Renamed ConnectionManager to ConnectionDispatcher.
Because that's what it does.
2014-11-05 19:47:54 +00:00
akwizgran 4ca83842d1 Moved ConnectionDispatcher and ConnectionRegistry to plugins package. 2014-11-05 19:40:07 +00:00
akwizgran 7b8181e309 Massive refactoring to merge handling of simplex and duplex connections. 2014-11-04 16:51:25 +00:00
akwizgran b24f153704 Renamed a load of things from 'connection' to 'stream'. 2014-10-08 16:21:55 +01:00
akwizgran 941efb4bbe Merged IncomingConnectionExecutor and PluginExecutor into IoExecutor.
We don't need two separate executors for long-running IO threads.
2014-10-02 18:02:53 +01:00
akwizgran 7aa836c683 Skip tests that can't be run on the present machine. 2014-04-10 13:15:54 +01:00
akwizgran cc9e1ec300 Rigorous address validation broke a unit test. 2014-04-05 00:00:59 +01:00
akwizgran e74465dd41 Don't try to connect to unreachable IP addresses. 2014-04-05 00:00:58 +01:00
akwizgran 08b91d2483 Poll plugins when connectivity changes. Bug #66.
This should enable us to connect to contacts faster at startup and
whenever a new means of connecting becomes available.
2014-04-04 22:06:36 +01:00
akwizgran fe82591fdf Cleaned up address selection code for LAN and WAN plugins.
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.
2014-04-04 20:04:47 +01:00
akwizgran 044c10e89f Bluetooth-only invitations: simpler and more reliable.
Of course, not all devices support Bluetooth...
2014-02-10 14:00:34 +00:00