def __init__(self): self.c = Client('c4', 26000, 'ff01::1') self.c.subscribe("pelle", DetailedCallback(self.printFrame)) self.c.subscribe("mo.*", DetailedCallback(self.printFrame)) self.c.subscribe("moj.*", DetailedCallback(self.printFrame)) t = Thread(target=self.c.run) t.daemon = True t.start()
class hepp(): def __init__(self): self.c = Client('c1', 26000, 'ff01::1') self.c.registerBusInterface("print", Callback(self.printFrame)) t = Thread(target=self.c.run) t.daemon = True t.start() def printFrame(self, message): print (message) return "This was Fun."
class hepp(): def __init__(self): self.c = Client('c3', 26000, 'ff01::1') t = Thread(target=self.c.run) t.daemon = True t.start() def publish(self, channel): reply = self.c.publish("This is a message" + channel, channel) print(reply)
class hepp(): def __init__(self): self.c = Client('c2', 26000, 'ff01::1') t = Thread(target=self.c.run) t.daemon = True t.start() def request(self): reply = self.c.request('c1', 'print', "This is a message", 10) print(reply)
class hepp(): def __init__(self): self.c = Client('c4', 26000, 'ff01::1') self.c.subscribe("pelle", DetailedCallback(self.printFrame)) self.c.subscribe("mo.*", DetailedCallback(self.printFrame)) self.c.subscribe("moj.*", DetailedCallback(self.printFrame)) t = Thread(target=self.c.run) t.daemon = True t.start() def printFrame(self, senderId, topic, mid, message): print(topic + "#" + message) def unsubscribe(self): self.c.unsubscribe("mo.*")
def __init__(self): self.c = Client('c1', 26000, 'ff01::1') self.c.registerBusInterface("print", Callback(self.printFrame)) t = Thread(target=self.c.run) t.daemon = True t.start()
def __init__(self): self.c = Client('c3', 26000, 'ff01::1') t = Thread(target=self.c.run) t.daemon = True t.start()