diff options
Diffstat (limited to 'sugar/p2p/NotificationListener.py')
-rw-r--r-- | sugar/p2p/NotificationListener.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/sugar/p2p/NotificationListener.py b/sugar/p2p/NotificationListener.py deleted file mode 100644 index e490f39..0000000 --- a/sugar/p2p/NotificationListener.py +++ /dev/null @@ -1,27 +0,0 @@ -from Service import Service -import network - -class NotificationListener: - TYPE = "_olpc_model_notification._udp" - ADDRESS = "224.0.0.222" - PORT = 6300 - - def __init__(self, group, name): - server = network.GroupServer(NotificationListener.TYPE, - NotificationListener.PORT, - self._recv_multicast) - server.start() - - service = Service(name, NotificationListener.TYPE, - NotificationListener.ADDRESS, - NotificationListener.PORT, True) - service.register(group) - - self._listeners = {} - - def add_listener(self, listener): - self._listeners.add(listener) - - def _recv_multicast(self, msg): - for listener in self._listeners: - listener(msg) |