Clean up some routine stuff like pings, and stop keeping links open forever even if there are no frames passing between them.

This commit is contained in:
Adam Ierymenko 2013-10-02 16:12:10 -04:00
commit 58538500f2
7 changed files with 85 additions and 70 deletions

View file

@ -144,6 +144,15 @@ public:
*/
bool sendFirewallOpener(const RuntimeEnvironment *_r,uint64_t now);
/**
* Send HELLO to a peer using one or both active link types
*
* @param _r Runtime environment
* @param now Current time
* @return True if send appears successful for at least one address type
*/
bool sendPing(const RuntimeEnvironment *_r,uint64_t now);
/**
* Set an address to reach this peer
*
@ -222,18 +231,6 @@ public:
return _lastAnnouncedTo;
}
/**
* Set the time of last announcement
*
* @param t Time, typically current
*/
inline void setLastAnnouncedTo(const uint64_t t)
throw()
{
_lastAnnouncedTo = t;
_dirty = true;
}
/**
* @return Lowest of measured latencies of all paths or 0 if unknown
*/
@ -274,8 +271,9 @@ public:
}
/**
* @return True if this peer has at least one direct IP address path that looks active
*
* @param now Current time
* @return True if hasDirectPath() is true and at least one path is active
*/
inline bool hasActiveDirectPath(uint64_t now) const
throw()