Added link age to link API

pull/542/head
Mark Qvist 2024-08-28 20:36:51 +02:00
rodzic f1d6cda337
commit 6ac07989b0
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -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.