Example #1
0
def update_db():
    idlist = set()
    idlist.add(misc.getLocalID())
    idlist.add(settings.CentralID())
    #Not sure we need this:
    #idlist.add(settings.MoneyServerID())
    idlist = idlist.union(contacts.getContactsAndCorrespondents())

    add_identity2db(idlist)
Example #2
0
 def doStartAllUDPSessions(self, arg):
     all = contacts.getContactsAndCorrespondents()
     if not self.debug:
         all.append(settings.CentralID())
     for idurl in all:
         ident = contacts.getContact(idurl)
         if ident is None:
             continue
         address = ident.getProtoContact('udp')
         if address is None:
             continue
         try:
             proto, ip, port, filename = nameurl.UrlParse(address)
             address = (ip, int(port))
         except:
             dhnio.DprintException()
             continue
         address = self.remapAddress(address)
         sess = transport_udp_session.open_session(address)
         dhnio.Dprint(8, 'transport_udp.doStartAllUDPSessions init %s with [%s]' % (sess.name, nameurl.GetName(idurl)))
         sess.automat('init', idurl)