Matthias Radestock
eecaa567fc
eliminate periodic 'tick' in connection_maker
...
checkStateAndAttemptConnections already performs a full scan of all
potential targets, from which we can easily determine the nearest
future time (or, rather, its duration from now) on which an attempt is
due.
We also need to kick the ConnectionMaker into action when we receive a
topology update containing new connections.
2014-09-22 23:15:54 +01:00
Matthias Radestock
d5e797f695
refactor: use better 'switch'
2014-09-22 22:34:46 +01:00
Matthias Radestock
f11f84fe17
refactor: we don't care about the tick time
2014-09-22 19:38:21 +01:00
Matthias Radestock
aa1e1b1d6c
cosmetic - remove comment for which we have an issue filed
2014-09-22 18:34:50 +01:00
Bryan Boreham
f0191639de
Start the tick again, in case we need it
2014-09-18 06:51:12 +01:00
Bryan Boreham
2720d24183
Attempt re-connection immediately when notified of a broken connection
2014-09-18 06:48:56 +01:00
Matthias Radestock
8b37e07823
get rid of connection attempt count tracking
2014-09-15 15:05:40 +01:00
Matthias Radestock
5b18864aec
refactoring
...
- rename addToTargets to addTarget
- immediately add to cm.targets; the phasing was unnecessary
- don't normalise addresses in addTarget - they are already normalised
2014-09-15 13:51:57 +01:00
Matthias Radestock
34bec14e3e
cosmetic
2014-09-10 17:48:53 +01:00
Matthias Radestock
bf38e902f2
ensure validTarget only contains addresses we aren't connected to
2014-09-10 17:47:48 +01:00
Bryan Boreham
661b3f4da1
command-line addresses are already normalised so don't need to do it again
2014-09-10 17:40:39 +01:00
Matthias Radestock
1b3122b37b
refactor: eliminate some helper functions
2014-09-10 17:02:16 +01:00
Matthias Radestock
20bfdc2e73
refactor
2014-09-10 16:54:22 +01:00
Matthias Radestock
9b1ec19432
refactor
2014-09-10 16:51:26 +01:00
Matthias Radestock
4a3fc47246
cosmetic
2014-09-10 16:47:41 +01:00
Matthias Radestock
145ebf3950
cosmetic: remove disabled log statements
2014-09-10 16:47:20 +01:00
Matthias Radestock
8488646e7b
refactor: change method/signal name
2014-09-10 16:42:33 +01:00
Matthias Radestock
4e442393b2
refactor: 'enum' -> bool
2014-09-10 16:39:05 +01:00
Matthias Radestock
ce2d3ff30a
cosmetic
2014-09-10 16:35:31 +01:00
Bryan Boreham
c6d8623b6f
Only signal connection failures; remove successful connections when we see them
2014-09-10 16:17:56 +01:00
Bryan Boreham
0e23c29cae
cosmetic
2014-09-10 16:02:50 +01:00
Bryan Boreham
651c0a0c27
Remove tickNow() function
2014-09-10 16:00:31 +01:00
Bryan Boreham
c28ff33c84
Avoid waiting 5 seconds before starting
2014-09-10 15:26:13 +01:00
Bryan Boreham
83175cdd0a
Normalise IP addresses when adding to collections
2014-09-10 15:25:10 +01:00
Bryan Boreham
e5bd3933d8
Normalise peer address before checking
2014-09-10 14:59:32 +01:00
Bryan Boreham
2050569fb6
Break checkStateAndAttemptConnections into phases, and track the end of all connection attempts
2014-09-10 14:50:43 +01:00
Bryan Boreham
9d0af9dbfe
Keep targets around until their attempt fails
2014-09-10 14:18:41 +01:00
Bryan Boreham
4335615688
Track command-line targets in a separate set, to simplify tracking of targets
2014-09-10 14:12:37 +01:00
Bryan Boreham
634d4e0fe3
cosmetic
2014-09-10 13:45:56 +01:00
Bryan Boreham
cd92fad369
Simplify lookup in our_connected_peers
2014-09-10 13:15:56 +01:00
Bryan Boreham
b3b3ba9a21
cleaned up reconnect algorithm to improve locking, replace count with bool
2014-09-10 13:08:20 +01:00
Bryan Boreham
3644531c50
change counts to boolean when deciding if everything is connnected
2014-09-10 12:35:28 +01:00
Bryan Boreham
26f8a68a82
Remove stuff that is not needed with new ConnectionMaker approach
2014-09-10 12:29:21 +01:00
Bryan Boreham
84aeaf340a
New implementation of ConnectionMaker just periodically scanning who we need to connect to
2014-09-10 12:08:49 +01:00
Bryan Boreham
42ce45dd55
remove debugging code added by accident
2014-09-09 13:10:37 +01:00
Bryan Boreham
c074c2991d
Pull a couple of common bits of code out into utils.go
2014-09-09 13:03:14 +01:00
Bryan Boreham
527ddfca0d
Clean up naming of commands and states
2014-09-09 12:04:05 +01:00
Bryan Boreham
2f53df8a97
Check if we already have a connection on an address before attempting to connect to it
2014-09-09 11:27:46 +01:00
Bryan Boreham
64999d830d
State of connection is now three-way choice rather than two booleans
2014-09-08 17:30:54 +01:00
Bryan Boreham
16e9daf057
Reformatted with 'go fmt'
2014-09-08 16:25:55 +01:00
Bryan Boreham
a3312c822c
Attempt to connect immediately when given a new connection
2014-09-08 16:05:54 +01:00
Bryan Boreham
5cf2cb0c50
Keep track of which connections have been established
2014-09-08 15:36:19 +01:00
Bryan Boreham
dec794eb72
Remove all references to PeerName in ConnectionMaker
2014-09-08 15:05:50 +01:00
Bryan Boreham
8b3e97b96a
Change from stating which peer we expect to be on the end of a connection to accepting any known peer
2014-09-08 14:07:42 +01:00
Bryan Boreham
0a94388f0a
Change ConnectionMaker from being focused on PeerName to being focused on address
2014-09-08 12:42:06 +01:00
Bryan Boreham
783ee21461
Continue after we establish that there is nothing left to do for failedCOnnection
2014-09-05 18:28:42 +01:00
Bryan Boreham
5c7010625a
Remove entries from the failedConnection list when they succeed.
...
Avoids unsightly error messages where both ends make the same
connection and we then have to drop one of them.
2014-09-05 15:45:32 +01:00
Bryan Boreham
54d7972b5e
Don't start a new connection attempt until all in-flight attempts for this peer have finished
...
Also cleaned up the naming slightly
2014-09-05 14:26:42 +01:00
Bryan Boreham
09271f4848
Track which connections we are currently attempting a connect on, so we don’t do multiple attempts at the same time to the same endpoint
2014-09-05 11:16:13 +01:00
Matthias Radestock
e6feefa1fc
initial commit
2014-08-18 17:55:26 +01:00