sugar-toolkit-gtk3/sugar/p2p/Notifier.py
Marco Pesenti Gritti d2a0bd4d65 More fixes...
2006-05-15 15:36:17 -04:00

20 lines
484 B
Python

from sugar.p2p import network
from sugar.p2p.Service import Service
class Notifier:
TYPE = "_olpc_model_notification._udp"
ADDRESS = "224.0.0.222"
PORT = 6300
def __init__(self, group, name):
service = Service(name, Notifier.TYPE, Notifier.ADDRESS,
Notifier.PORT, True)
service.register(group)
address = service.get_address()
port = service.get_port()
self._client = network.GroupClient(address, port)
def notify(self, msg):
self._client.send_msg(msg)