Use random port for local models, clean up some model code, and don't double-register models when we hear our own announcement

This commit is contained in:
Dan Williams
2006-06-23 13:13:28 -04:00
parent 7e50e0c8a1
commit db90d4a209
3 changed files with 2 additions and 5 deletions
+1 -2
View File
@@ -17,7 +17,6 @@ class ModelRequestHandler(object):
class LocalModel(AbstractModel):
SERVICE_TYPE = "_olpc_model._tcp"
SERVICE_PORT = 6300
def __init__(self, activity, pservice, service):
AbstractModel.__init__(self)
@@ -40,7 +39,7 @@ class LocalModel(AbstractModel):
def _setup_service(self):
service = self._pservice.share_activity(self._activity,
stype = LocalModel.SERVICE_TYPE,
address = '', port = LocalModel.SERVICE_PORT)
address = '')
self._setup_server(service)
# FIXME this is duplicated with StreamReader
-1
View File
@@ -24,6 +24,5 @@ class RemoteModel(AbstractModel):
self._client.set_value(key, value)
def _setup_notification_listener(self):
name = self._service.get_name()
self._notification = NotificationListener(self._notification_service)
self._notification.add_listener(self._notify_model_change)