mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-12-22 11:50:18 +00:00
Added link age to link API
This commit is contained in:
parent
f1d6cda337
commit
6ac07989b0
@ -462,6 +462,15 @@ class Link:
|
||||
def get_context(self):
|
||||
return None
|
||||
|
||||
def get_age(self):
|
||||
"""
|
||||
:returns: The time in seconds since this link was established.
|
||||
"""
|
||||
if self.activated_at:
|
||||
return time.time() - self.activated_at
|
||||
else:
|
||||
return None
|
||||
|
||||
def no_inbound_for(self):
|
||||
"""
|
||||
:returns: The time in seconds since last inbound packet on the link. This includes keepalive packets.
|
||||
|
Loading…
Reference in New Issue
Block a user