Example #1
0
def checktimeouts():
    tdel = []
    c_w_lan = contacts.all_with_transport('lan')
    if(c_w_lan == []): return True
    for lc in c_w_lan:
        cur_contact = contacts.Contactlist[lc].Transports['lan']
        if((time.time() - cur_contact.lastseen) > (bcast_time * bcast_remove_factor)):
            tdel.append(lc)
            print(tdel)
    for lc in tdel: contacts.Contactlist[lc].del_transport('lan')
Example #2
0
def peer_by_lan_ipport(ip,port):
    c_w_lan = contacts.all_with_transport('lan')
    if(c_w_lan == []): return True
    for lc in c_w_lan:
        if(contacts.Contactlist[lc].Transports['lan'].ip == ip and contacts.Contactlist[lc].Transports['lan'].port == port): return lc
    return -1