Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/d/h/DHTBot-HEAD/dhtbot/protocols/krpc_responder.py   DHTBot(Download)
    def ping_Received(self, query, address):
        # The ping response needs no additional protocol
        # data, so build_response() is empty
        response = query.build_response()
        self.sendResponse(response, address)
        # Include the nodes in the response
        response = query.build_response(nodes=nodes)
        self.sendResponse(response, address)
 
    def get_peers_Received(self, query, address):
        # Attach the peers, nodes, and token to the response message
        response = query.build_response(nodes=nodes, peers=peers, token=token)
        self.sendResponse(response, address)
 
    def announce_peer_Received(self, query, address):
            # data (and serve just as a confirmation)
            response = query.build_response()
            self.sendResponse(response, address)
        else:
            log.msg("Invalid token/query/querier combination in"