Beispiel #1
0
class Flooder(object):
    def __init__(self, addrs, me, master, net):
        self.addrs = addrs
        self.r = BufSocket(me, net)
        self.me = me
        self.master = master

    def flood(self, orig, data):
        for a in filter(lambda x: x != orig, self.addrs):
            self.r.sendto(data, a)

    def flood_ack(self, t, entry, seq):
        assert type(entry.key) is str
        inc_clock()
        self.flood(None, (tuple(entry), self.master, t, self.me, seq, clock))
Beispiel #2
0
 def __init__(self, addrs, me, master, net):
     self.addrs = addrs
     self.r = BufSocket(me, net)
     self.me = me
     self.master = master