Esempio n. 1
0
		void EventConnection::raiseEvent(const dtn::core::NodeEvent &node) throw ()
		{
			ibrcommon::MutexLock l(_mutex);
			if (!_running) return;

			// start with the event tag
			_stream << "Event: " << node.getName() << std::endl;
			_stream << "Action: ";

			switch (node.getAction())
			{
			case dtn::core::NODE_AVAILABLE:
				_stream << "available";
				break;
			case dtn::core::NODE_UNAVAILABLE:
				_stream << "unavailable";
				break;
			case dtn::core::NODE_DATA_ADDED:
				_stream << "data_added";
				break;
			case dtn::core::NODE_DATA_REMOVED:
				_stream << "data_removed";
				break;
			default:
				break;
			}

			_stream << std::endl;

			// write the node eid
			_stream << "EID: " << node.getNode().getEID().getString() << std::endl;

			// close the event
			_stream << std::endl;
		}
Esempio n. 2
0
		void NodeHandshakeExtension::raiseEvent(const dtn::core::NodeEvent &nodeevent) throw ()
		{
			// If a new neighbor comes available, send him a request for the summary vector
			// If a neighbor went away we can free the stored summary vector
			const dtn::core::Node &n = nodeevent.getNode();

			if (nodeevent.getAction() == NODE_UNAVAILABLE)
			{
				// remove the item from the blacklist
				_endpoint.removeFromBlacklist(n.getEID());
			}
		}