Esempio n. 1
0
 def response_to_sender(self, sender, message_id, ret_code, ret_message, parameters, bin_data_pointer=None):
     if bin_data_pointer:
         binary_data = FileBasedChunks.from_data_pointer(bin_data_pointer) 
     else:
         binary_data = None
     resp = FabnetPacketResponse(message_id=message_id, ret_code=ret_code, \
                             ret_message=ret_message, ret_parameters=parameters, \
                             binary_data=binary_data)
     self.__call_operation(sender, resp)
Esempio n. 2
0
    def async_remote_call(self, node_address, operation, parameters, multicast=False, bin_data_pointer=None):
        if bin_data_pointer:
            binary_data = FileBasedChunks.from_data_pointer(bin_data_pointer) 
        else:
            binary_data = None
        req = FabnetPacketRequest(method=operation, sender=self.self_address, \
                parameters=parameters, binary_data=binary_data)
        if multicast:
            self.call_network(req, node_address)
        else:
            self.call_node(node_address, req)

        return req.message_id