def get_subscribers(self): """Return a list of SubscriberDescriptor objects for all subscribers""" s = [] for service_name, subscriptions in self._subscribers.items(): for rref, (subscriber_info, when) in subscriptions.items(): # note that if the subscriber didn't do Tub.setLocation, # tubid will be None. Also, subscribers do not tell us which # pubkey they use; only publishers do that. tubid = rref.getRemoteTubID() or "?" advertised_addresses = rrefutil.hosts_for_rref(rref) remote_address = rrefutil.stringify_remote_address(rref) # these three assume subscriber_info["version"]==0, but # should tolerate other versions if not subscriber_info: # V1 clients that haven't yet sent their stub_info data subscriber_info = {} nickname = subscriber_info.get("nickname", u"?") version = subscriber_info.get("my-version", u"?") app_versions = subscriber_info.get("app-versions", {}) # 'when' is the time they subscribed sd = SubscriberDescriptor(service_name, when, nickname, version, app_versions, advertised_addresses, remote_address, tubid) s.append(sd) return s
def get_subscribers(self): """Return a list of SubscriberDescriptor objects for all subscribers""" s = [] for service_name, subscriptions in self._subscribers.items(): for rref,(subscriber_info,when) in subscriptions.items(): # note that if the subscriber didn't do Tub.setLocation, # tubid will be None. Also, subscribers do not tell us which # pubkey they use; only publishers do that. tubid = rref.getRemoteTubID() or "?" advertised_addresses = rrefutil.hosts_for_rref(rref) remote_address = rrefutil.stringify_remote_address(rref) # these three assume subscriber_info["version"]==0, but # should tolerate other versions if not subscriber_info: # V1 clients that haven't yet sent their stub_info data subscriber_info = {} nickname = subscriber_info.get("nickname", u"?") version = subscriber_info.get("my-version", u"?") app_versions = subscriber_info.get("app-versions", {}) # 'when' is the time they subscribed sd = SubscriberDescriptor(service_name, when, nickname, version, app_versions, advertised_addresses, remote_address, tubid) s.append(sd) return s
def get_subscribers(self): s = [] for service_name, subscribers in self._subscribers.items(): for rref, when in subscribers.items(): tubid = rref.getRemoteTubID() or "?" advertised_addresses = rrefutil.hosts_for_rref(rref) remote_address = rrefutil.stringify_remote_address(rref) nickname, version, app_versions = u"?", u"?", {} sd = SubscriberDescriptor( service_name, when, nickname, version, app_versions, advertised_addresses, remote_address, tubid ) s.append(sd) return s
def get_subscribers(self): s = [] for service_name, subscribers in self._subscribers.items(): for rref, when in subscribers.items(): tubid = rref.getRemoteTubID() or "?" advertised_addresses = rrefutil.hosts_for_rref(rref) remote_address = rrefutil.stringify_remote_address(rref) nickname, version, app_versions = u"?", u"?", {} sd = SubscriberDescriptor(service_name, when, nickname, version, app_versions, advertised_addresses, remote_address, tubid) s.append(sd) return s