Ejemplo n.º 1
0
		void EMailConvergenceLayer::queue(const dtn::core::Node &node,
				const dtn::net::BundleTransfer &job)
		{
			// Check if node supports email convergence layer
			const std::list<dtn::core::Node::URI> uri_list = node.get(dtn::core::Node::CONN_EMAIL);
			if (uri_list.empty())
			{
				dtn::net::TransferAbortedEvent::raise(node.getEID(), job.getBundle(),
						dtn::net::TransferAbortedEvent::REASON_UNDEFINED);
				return;
			}

			// Get recipient
			std::string recipient = dtn::utils::Utils::tokenize("//", node.getEID().getString())[1];

			// Create new Task
			EMailSmtpService::Task *t = new EMailSmtpService::Task(node, job, recipient);

			// Submit Task
			if(_config.getSmtpSubmitInterval() <= 0)
			{
				_smtp.submitNow(t);
			}else{
				_smtp.queueTask(t);
			}

			IBRCOMMON_LOGGER(info) << "EMail Convergence Layer: Bundle " << t->getJob().getBundle().toString() << " stored in submit queue" << IBRCOMMON_LOGGER_ENDL;

		}
Ejemplo n.º 2
0
/**
 * Queue job for delivery to another node
 * @param job
 */
void DatagramConnection::queue(const dtn::net::BundleTransfer &job)
{
    IBRCOMMON_LOGGER_DEBUG_TAG(DatagramConnection::TAG, 15) << "queue bundle " << job.getBundle().toString() << " to " << job.getNeighbor().getString() << IBRCOMMON_LOGGER_ENDL;
    _sender.queue.push(job);
}