mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-19 21:03:57 -07:00
Tons of refactoring, change to desperation algorithm to use max of core or link, porting over core loop code from old Node.cpp to new CAPI version, etc.
This commit is contained in:
parent
9e55f882d3
commit
49f031ccb4
14 changed files with 277 additions and 254 deletions
|
@ -183,21 +183,12 @@ public:
|
|||
void attemptToContactAt(const RuntimeEnvironment *RR,const InetAddress &atAddress,unsigned int linkDesperation,uint64_t now);
|
||||
|
||||
/**
|
||||
* Send a HELLO to all active direct paths
|
||||
* Send pings or keepalives depending on configured timeouts
|
||||
*
|
||||
* @param RR Runtime environment
|
||||
* @param now Current time
|
||||
*/
|
||||
inline void ping(const RuntimeEnvironment *RR,uint64_t now)
|
||||
{
|
||||
unsigned int np = _numPaths;
|
||||
for(unsigned int p=0;p<np;++p) {
|
||||
if (_paths[p].active(now)) {
|
||||
attemptToContactAt(RR,_paths[p].address(),_paths[p].desperation(now),now);
|
||||
_paths[p].sent(now);
|
||||
}
|
||||
}
|
||||
}
|
||||
void doPingAndKeepalive(const RuntimeEnvironment *RR,uint64_t now);
|
||||
|
||||
/**
|
||||
* @return All known direct paths to this peer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue