def _init_node(self, node): # start receiver receiver_cmd = "%s %i" % ( self.get_binary_path("tcp_receive"), configuration.get_tcp_receiver_port()) receiver_process = process.ReceiverProcess(node, receiver_cmd) receiver_pid = self._process_manager.start_process(receiver_process) self.__node_to_receiver_pid_map[node] = receiver_pid
def transmit_n_bytes(self, coflow_id, source, destination, n_bytes, subscription_key): topology = network_emulator.NetworkEmulator.get_instance().topology destination_ip = topology.get_ip_address(destination.nn) trans_command = "%s %s %i %i" % ( self.get_binary_path("tcp_send"), destination_ip, configuration.get_tcp_receiver_port(), n_bytes) trans_process = process.TransmissionProcess(source, trans_command, subscription_key) if not self._process_manager.start_process(trans_process): return -1 return trans_process.transmission_id