Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
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."
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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.*")
Ejemplo n.º 6
0
 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()
Ejemplo n.º 7
0
 def __init__(self):
     self.c = Client('c3', 26000, 'ff01::1')
     t = Thread(target=self.c.run)
     t.daemon = True
     t.start()