def connect(self, peers, btree, pub_url, root_id=<NUM_LIT:0>):
<EOL>self.nchildren = list(btree.values()).count(self.id)<EOL>if self.root:<EOL><INDENT>return <EOL><DEDENT>root_location = peers[root_id][-<NUM_LIT:1>]<EOL>self.sub.connect(disambiguate_dns_url(pub_url, root_location))<EOL>parent = btree[self.id]<EOL>tree_url, location = peers[parent]<EOL>self.upstream.connect(disambiguate_dns_url(tree_url, location))<EOL>
connect to peers.  `peers` will be a dict of 4-tuples, keyed by name.
        {peer : (ident, addr, pub_addr, location)}
        where peer is the name, ident is the XREP identity, addr,pub_addr are the