Exemple #1
0
int Manager::addDestination(int src_id, int dest_id, char* ip, int port) {
	LOG4CXX_DEBUG(logger, "Adding destination at src_id: " << src_id << " dest_id: " << dest_id);

	//Pointer to socketWorker
	Worker *s = NULL;

	if (srcIdWorker.count(src_id) > 0) {
		s = srcIdWorker[src_id];
		// Add the new destination to the worker
		s->addDestination(src_id, dest_id, ip, port);
		return 0;
	} else {
		LOG4CXX_ERROR(logger, "Source Id: " << src_id << " doesn't exist");
		return -1;
	}
}