• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IBRCOMMON_LOGGER_DEBUG_TAG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IBRCOMMON_LOGGER_DEBUG_TAG函数的典型用法代码示例。如果您正苦于以下问题:C++ IBRCOMMON_LOGGER_DEBUG_TAG函数的具体用法?C++ IBRCOMMON_LOGGER_DEBUG_TAG怎么用?C++ IBRCOMMON_LOGGER_DEBUG_TAG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IBRCOMMON_LOGGER_DEBUG_TAG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: throw

		void IPNDAgent::leave(const ibrcommon::vinterface &iface, const ibrcommon::vaddress &addr) throw ()
		{
			IBRCOMMON_LOGGER_DEBUG_TAG(TAG, 10) << "Leave " << iface.toString() << " (" << addr.toString() << ", family: " << addr.family() << ")" << IBRCOMMON_LOGGER_ENDL;

			// get all sockets bound to the given interface
			ibrcommon::socketset ifsocks = _socket.get(iface);

			for (ibrcommon::socketset::iterator it = ifsocks.begin(); it != ifsocks.end(); ++it)
			{
				ibrcommon::multicastsocket *msock = dynamic_cast<ibrcommon::multicastsocket*>(*it);
				if (msock == NULL) continue;

				if (msock->get_address() == addr) {
					// remove the socket
					_socket.remove(msock);

					// shutdown the socket
					try {
						msock->down();
					} catch (const ibrcommon::socket_exception &ex) {
						IBRCOMMON_LOGGER_DEBUG_TAG(IPNDAgent::TAG, 10) << "leave failed: " << ex.what() << IBRCOMMON_LOGGER_ENDL;
					}

					// delete the socket
					delete msock;

					return;
				}
			}
		}
开发者ID:iamyangchen,项目名称:ibrdtn,代码行数:30,代码来源:IPNDAgent.cpp


示例2: throw

		void NativeSession::receive() throw (NativeSessionException)
		{
			Registration &reg = _registration;
			try {
				try {
					const dtn::data::MetaBundle id = reg.receiveMetaBundle();

					if (id.procflags & dtn::data::PrimaryBlock::APPDATA_IS_ADMRECORD) {
						// transform custody signals & status reports into notifies
						fireNotificationAdministrativeRecord(id);

						// announce the delivery of this bundle
						reg.delivered(id);
					} else {
						IBRCOMMON_LOGGER_DEBUG_TAG(NativeSession::TAG, 20) << "fire notification for new bundle " << id.toString() << IBRCOMMON_LOGGER_ENDL;

						// put the bundle into the API queue
						_bundle_queue.push(id);

						// notify the client about the new bundle
						fireNotificationBundle(id);
					}
				} catch (const dtn::storage::NoBundleFoundException&) {
					IBRCOMMON_LOGGER_DEBUG_TAG(NativeSession::TAG, 25) << "no more bundles found - wait until we are notified" << IBRCOMMON_LOGGER_ENDL;
					reg.wait_for_bundle();
				}
			} catch (const ibrcommon::QueueUnblockedException &ex) {
				throw NativeSessionException(std::string("loop aborted - ") + ex.what());
			} catch (const std::exception &ex) {
				throw NativeSessionException(std::string("loop aborted - ") + ex.what());
			}
		}
开发者ID:abrahammartin,项目名称:ibrdtn,代码行数:32,代码来源:NativeSession.cpp


示例3: throw

		void SecurityManager::fastverify(const dtn::data::Bundle &bundle) const throw (VerificationFailedException)
		{
			// do a fast verify without manipulating the bundle
			const dtn::daemon::Configuration::Security &secconf = dtn::daemon::Configuration::getInstance().getSecurity();

			if (secconf.getLevel() & dtn::daemon::Configuration::Security::SECURITY_LEVEL_ENCRYPTED)
			{
				// check if the bundle is encrypted and throw an exception if not
				//throw VerificationFailedException("Bundle is not encrypted");
				IBRCOMMON_LOGGER_DEBUG_TAG("SecurityManager", 10) << "encryption required, verify bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;

				if (std::count(bundle.begin(), bundle.end(), dtn::security::PayloadConfidentialBlock::BLOCK_TYPE) == 0)
					throw VerificationFailedException("No PCB available!");
			}

			if (secconf.getLevel() & dtn::daemon::Configuration::Security::SECURITY_LEVEL_SIGNED)
			{
				// check if the bundle is signed and throw an exception if not
				//throw VerificationFailedException("Bundle is not signed");
				IBRCOMMON_LOGGER_DEBUG_TAG("SecurityManager", 10) << "signature required, verify bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;

				if (std::count(bundle.begin(), bundle.end(), dtn::security::PayloadIntegrityBlock::BLOCK_TYPE) == 0)
					throw VerificationFailedException("No PIB available!");
			}

			if (secconf.getLevel() & dtn::daemon::Configuration::Security::SECURITY_LEVEL_AUTHENTICATED)
			{
				// check if the bundle is signed and throw an exception if not
				//throw VerificationFailedException("Bundle is not signed");
				IBRCOMMON_LOGGER_DEBUG_TAG("SecurityManager", 10) << "authentication required, verify bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;

				if (std::count(bundle.begin(), bundle.end(), dtn::security::BundleAuthenticationBlock::BLOCK_TYPE) == 0)
					throw VerificationFailedException("No BAB available!");
			}
		}
开发者ID:danieldelacasa,项目名称:ibrdtn,代码行数:35,代码来源:SecurityManager.cpp


示例4: IBRCOMMON_LOGGER_DEBUG_TAG

		void NativeSession::fireNotificationAdministrativeRecord(const dtn::data::MetaBundle &bundle)
		{
			// load the whole bundle
			const dtn::data::Bundle b = dtn::core::BundleCore::getInstance().getStorage().get(bundle);

			// get the payload block of the bundle
			const dtn::data::PayloadBlock &payload = b.find<dtn::data::PayloadBlock>();

			try {
				// try to decode as status report
				dtn::data::StatusReportBlock report;
				report.read(payload);

				IBRCOMMON_LOGGER_DEBUG_TAG(NativeSession::TAG, 20) << "fire notification for status report" << IBRCOMMON_LOGGER_ENDL;

				// fire the status report notification
				fireNotificationStatusReport(b.source, report);
			} catch (const dtn::data::StatusReportBlock::WrongRecordException&) {
				// this is not a status report
			}

			try {
				// try to decode as custody signal
				dtn::data::CustodySignalBlock custody;
				custody.read(payload);

				IBRCOMMON_LOGGER_DEBUG_TAG(NativeSession::TAG, 20) << "fire notification for custody signal" << IBRCOMMON_LOGGER_ENDL;

				// fire the custody signal notification
				fireNotificationCustodySignal(b.source, custody);
			} catch (const dtn::data::CustodySignalBlock::WrongRecordException&) {
				// this is not a custody report
			}
		}
开发者ID:abrahammartin,项目名称:ibrdtn,代码行数:34,代码来源:NativeSession.cpp


示例5: throw

		void IPNDAgent::join(const ibrcommon::vinterface &iface) throw ()
		{
			// register as discovery handler for this interface
			dtn::core::BundleCore::getInstance().getDiscoveryAgent().registerService(iface, this);

			// do not create sockets for any interface
			if (!iface.isAny()) {
				// subscribe to NetLink events on our interfaces
				ibrcommon::LinkManager::getInstance().addEventListener(iface, this);

				/**
				 * create sockets for each address on the interface
				 */
				const std::list<ibrcommon::vaddress> addrs = iface.getAddresses();

				for (std::list<ibrcommon::vaddress>::const_iterator it = addrs.begin(); it != addrs.end(); ++it)
				{
					const ibrcommon::vaddress addr = (*it);

					// join to all multicast addresses on this interface
					join(iface, addr);
				}
			}

			/**
			 * subscribe to multicast address on this interface using the sockets bound to any address
			 */
			const ibrcommon::vinterface any_iface(ibrcommon::vinterface::ANY);
			ibrcommon::socketset anysocks = _socket.get(any_iface);

			for (ibrcommon::socketset::iterator it = anysocks.begin(); it != anysocks.end(); ++it)
			{
				ibrcommon::multicastsocket *msock = dynamic_cast<ibrcommon::multicastsocket*>(*it);
				if (msock == NULL) continue;

				for (std::set<ibrcommon::vaddress>::const_iterator addr_it = _destinations.begin(); addr_it != _destinations.end(); ++addr_it)
				{
					const ibrcommon::vaddress &addr = (*addr_it);

					// join only if family matches
					if (addr.family() != msock->get_family()) continue;

					try {
						msock->join(addr, iface);

						IBRCOMMON_LOGGER_DEBUG_TAG(IPNDAgent::TAG, 10) << "Joined " << addr.toString() << " on " << iface.toString() << IBRCOMMON_LOGGER_ENDL;
					} catch (const ibrcommon::socket_raw_error &e) {
						if (e.error() == EADDRINUSE) {
							// silent error
						} else if (e.error() == 92) {
							// silent error - protocol not available
						} else {
							IBRCOMMON_LOGGER_TAG(IPNDAgent::TAG, warning) << "Join to " << addr.toString() << " failed on " << iface.toString() << "; " << e.what() << IBRCOMMON_LOGGER_ENDL;
						}
					} catch (const ibrcommon::socket_exception &e) {
						IBRCOMMON_LOGGER_DEBUG_TAG(IPNDAgent::TAG, 10) << "Join to " << addr.toString() << " failed on " << iface.toString() << "; " << e.what() << IBRCOMMON_LOGGER_ENDL;
					}
				}
			}
		}
开发者ID:bgernert,项目名称:ibrdtn,代码行数:60,代码来源:IPNDAgent.cpp


示例6: IBRCOMMON_LOGGER_DEBUG_TAG

		dtn::data::MetaBundle OrderedStreamHandler::get(const dtn::data::Timeout timeout)
		{
			Registration &reg = _client.getRegistration();
			IBRCOMMON_LOGGER_DEBUG_TAG("OrderedStreamHandler", 20) << "get()" << IBRCOMMON_LOGGER_ENDL;

			dtn::data::MetaBundle bundle;

			while (true)
			{
				try {
					bundle = reg.receiveMetaBundle();

					// discard bundle if they are not from the specified peer
					if ((!_group) && (bundle.source != _peer))
					{
						IBRCOMMON_LOGGER_DEBUG_TAG("OrderedStreamHandler", 30) << "get(): bundle source " << bundle.source.getString() << " not expected - discard" << IBRCOMMON_LOGGER_ENDL;
						continue;
					}

					break;
				} catch (const dtn::storage::NoBundleFoundException&) {
					IBRCOMMON_LOGGER_DEBUG_TAG("OrderedStreamHandler", 30) << "get(): no bundle found wait for notify" << IBRCOMMON_LOGGER_ENDL;
					reg.wait_for_bundle(timeout);
				}
			}

			return bundle;
		}
开发者ID:aayushjr,项目名称:ibrdtn,代码行数:28,代码来源:OrderedStreamHandler.cpp


示例7: elements_read

		std::istream& DeliveryPredictabilityMap::deserialize(std::istream& stream)
		{
			data::Number elements_read(0);
			data::Number map_size;
			stream >> map_size;

			while(elements_read < map_size)
			{
				/* read the EID */
				data::Number eid_len;
				stream >> eid_len;

				// create a buffer for the EID
				std::vector<char> eid_cstr(eid_len.get<size_t>());

				// read the EID string
				stream.read(&eid_cstr[0], eid_cstr.size());

				// convert the string into an EID object
				dtn::data::EID eid(std::string(eid_cstr.begin(), eid_cstr.end()));

				if(eid == data::EID())
					throw dtn::InvalidDataException("EID could not be casted, while parsing a dp_map.");

				/* read the probability (float) */
				float f;
				dtn::data::Number float_len;
				stream >> float_len;

				// create a buffer for the data string
				std::vector<char> f_cstr(float_len.get<size_t>());

				// read the data string
				stream.read(&f_cstr[0], f_cstr.size());

				// convert string data into a stringstream
				std::stringstream ss(std::string(f_cstr.begin(), f_cstr.end()));

				// convert string data into a float
				ss >> f;
				if(ss.fail())
					throw dtn::InvalidDataException("Float could not be casted, while parsing a dp_map.");

				/* check if f is in a proper range */
				if(f < 0 || f > 1)
					continue;

				/* insert the data into the map */
				_predictmap[eid] = f;

				elements_read += 1;
			}

			IBRCOMMON_LOGGER_DEBUG_TAG("DeliveryPredictabilityMap", 20) << "Deserialized with " << _predictmap.size() << " items." << IBRCOMMON_LOGGER_ENDL;
			IBRCOMMON_LOGGER_DEBUG_TAG("DeliveryPredictabilityMap", 60) << *this << IBRCOMMON_LOGGER_ENDL;
			return stream;
		}
开发者ID:bgernert,项目名称:ibrdtn,代码行数:57,代码来源:DeliveryPredictabilityMap.cpp


示例8: IBRCOMMON_LOGGER_DEBUG_TAG

		void FileMonitor::scan()
		{
			IBRCOMMON_LOGGER_DEBUG_TAG("FileMonitor", 5) << "scan for file changes" << IBRCOMMON_LOGGER_ENDL;

			std::set<ibrcommon::File> watch_set;

			for (watch_set::iterator iter = _watchset.begin(); iter != _watchset.end(); ++iter)
			{
				const ibrcommon::File &path = (*iter);
				std::list<ibrcommon::File> files;

				if (path.getFiles(files) == 0)
				{
					for (std::list<ibrcommon::File>::iterator iter = files.begin(); iter != files.end(); ++iter)
					{
						watch_set.insert(*iter);
					}
				}
				else
				{
					IBRCOMMON_LOGGER_TAG("FileMonitor", error) << "scan of " << path.getPath() << " failed" << IBRCOMMON_LOGGER_ENDL;
				}
			}

			// check for new directories
			for (std::set<ibrcommon::File>::iterator iter = watch_set.begin(); iter != watch_set.end(); ++iter)
			{
				const ibrcommon::File &path = (*iter);
				if (path.isDirectory() && !path.isSystem())
				{
					if (!isActive(path)) {
						adopt(path);
					}
				}
			}

			// look for gone directories
			for (std::map<ibrcommon::File, dtn::core::Node>::iterator iter = _active_paths.begin(); iter != _active_paths.end();)
			{
				const ibrcommon::File &path = (*iter).first;
				const dtn::core::Node &node = (*iter).second;

				if (watch_set.find(path) == watch_set.end())
				{
					dtn::core::BundleCore::getInstance().getConnectionManager().remove(node);
					IBRCOMMON_LOGGER_DEBUG_TAG("FileMonitor", 5) << "Node on drive gone: " << node.getEID().getString() << IBRCOMMON_LOGGER_ENDL;
					_active_paths.erase(iter++);
				}
				else
				{
					++iter;
				}
			}
		}
开发者ID:SebastianSchildt,项目名称:ibrdtnBLETest,代码行数:54,代码来源:FileMonitor.cpp


示例9: throw

void dtn::dht::DHTNameService::componentDown() throw () {
	// un-register as discovery beacon handler
	dtn::core::BundleCore::getInstance().getDiscoveryAgent().unregisterService(this);

	this->_exiting = true;
	IBRCOMMON_LOGGER_DEBUG_TAG("DHTNameService", 25) << "DHT will be shut down"
				<< IBRCOMMON_LOGGER_ENDL;
	ssize_t written = ::write(_interrupt_pipe[1], "i", 1);
	if (written < 1) {
		IBRCOMMON_LOGGER_DEBUG_TAG("DHTNameService", 25) << "DHT pipeline trick failed"
					<< IBRCOMMON_LOGGER_ENDL;
	}
}
开发者ID:SebastianSchildt,项目名称:ibrdtnBLETest,代码行数:13,代码来源:DHTNameService.cpp


示例10: IBRCOMMON_LOGGER_DEBUG_TAG

std::char_traits<char>::int_type DatagramConnection::Stream::overflow(std::char_traits<char>::int_type c)
{
    IBRCOMMON_LOGGER_DEBUG_TAG(DatagramConnection::TAG, 40) << "Stream::overflow()" << IBRCOMMON_LOGGER_ENDL;

    if (_abort) throw DatagramException("stream aborted");

    char *ibegin = &_out_buf[0];
    char *iend = pptr();

    // mark the buffer for outgoing data as free
    // the +1 sparse the first byte in the buffer and leave room
    // for the processing flags of the segment
    setp(&_out_buf[0], &_out_buf[0] + _buf_size - 1);

    if (!std::char_traits<char>::eq_int_type(c, std::char_traits<char>::eof()))
    {
        *iend++ = std::char_traits<char>::to_char_type(c);
    }

    // bytes to send
    const dtn::data::Length bytes = (iend - ibegin);

    // if there is nothing to send, just return
    if (bytes == 0)
    {
        IBRCOMMON_LOGGER_DEBUG_TAG(DatagramConnection::TAG, 35) << "Stream::overflow() nothing to sent" << IBRCOMMON_LOGGER_ENDL;
        return std::char_traits<char>::not_eof(c);
    }

    try {
        // disable skipping if this is the first segment
        if (_first_segment) _skip = false;

        // send segment to CL, use callback interface
        if (!_skip) _callback.stream_send(&_out_buf[0], bytes, _last_segment);

        // set the flags for the next segment
        _first_segment = _last_segment;
        _last_segment = false;
    } catch (const DatagramException &ex) {
        IBRCOMMON_LOGGER_DEBUG_TAG(DatagramConnection::TAG, 35) << "Stream::overflow() exception: " << ex.what() << IBRCOMMON_LOGGER_ENDL;

        // close this stream
        close();

        // re-throw the DatagramException
        throw;
    }

    return std::char_traits<char>::not_eof(c);
}
开发者ID:pipboy20k,项目名称:ibrdtn,代码行数:51,代码来源:DatagramConnection.cpp


示例11: throw

		void SecurityManager::verifyPIB(dtn::data::Bundle &bundle) const throw (VerificationFailedException)
		{
			IBRCOMMON_LOGGER_DEBUG_TAG("SecurityManager", 10) << "verify signed bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;

			// iterate through all blocks
			for (dtn::data::Bundle::iterator it = bundle.begin(); it != bundle.end();)
			{
				const dtn::data::Block &block = (**it);

				if (block.getType() == dtn::security::PayloadConfidentialBlock::BLOCK_TYPE) {
					// payload after a PCB can not verified until the payload is decrypted
					break;
				}

				try {
					const dtn::security::PayloadIntegrityBlock& pib = dynamic_cast<const dtn::security::PayloadIntegrityBlock&>(block);

					const SecurityKey key = SecurityKeyManager::getInstance().get(pib.getSecuritySource(bundle), SecurityKey::KEY_PUBLIC);

					// try to verify the bundle with the key for the current PIB
					dtn::security::PayloadIntegrityBlock::verify(bundle, key);

					// if we are the security destination
					if (pib.isSecurityDestination(bundle, dtn::core::BundleCore::local)) {
						// remove the valid PIB
						bundle.erase(it++);
					} else {
						++it;
					}

					// set the verify bit, after verification
					bundle.set(dtn::data::PrimaryBlock::DTNSEC_STATUS_VERIFIED, true);

					IBRCOMMON_LOGGER_DEBUG_TAG("SecurityManager", 5) << "Bundle " << bundle.toString() << " successfully verified" << IBRCOMMON_LOGGER_ENDL;
					continue;
				} catch (const dtn::security::VerificationSkippedException&) {
					// un-set the verify bit
					bundle.set(dtn::data::PrimaryBlock::DTNSEC_STATUS_VERIFIED, false);
				} catch (const SecurityKey::KeyNotFoundException&) {
					// un-set the verify bit
					bundle.set(dtn::data::PrimaryBlock::DTNSEC_STATUS_VERIFIED, false);
				} catch (const std::bad_cast&) {
					// current block is not a PIB
				}

				++it;
			}
		}
开发者ID:SebastianSchildt,项目名称:ibrdtnBLETest,代码行数:48,代码来源:SecurityManager.cpp


示例12: throw

		void AbstractWorker::AbstractWorkerAsync::run() throw ()
		{
			dtn::storage::BundleStorage &storage = BundleCore::getInstance().getStorage();

			try {
				while (_running)
				{
					dtn::data::BundleID id = _receive_bundles.getnpop(true);

					try {
						dtn::data::Bundle b = storage.get( id );
						prepareBundle(b);
						_worker.callbackBundleReceived( b );

						// create meta bundle for futher processing
						const dtn::data::MetaBundle meta = dtn::data::MetaBundle::create(b);

						// raise bundle event
						dtn::core::BundleEvent::raise(meta, BUNDLE_DELIVERED);

						if (b.get(dtn::data::PrimaryBlock::DESTINATION_IS_SINGLETON))
						{
							// remove the bundle from the storage
							dtn::core::BundlePurgeEvent::raise(meta);
						}
					} catch (const ibrcommon::Exception &ex) {
						IBRCOMMON_LOGGER_DEBUG_TAG("AbstractWorker", 15) << ex.what() << IBRCOMMON_LOGGER_ENDL;
					};

					yield();
				}
			} catch (const ibrcommon::QueueUnblockedException&) {
				// queue was aborted by another call
			}
		}
开发者ID:abrahammartin,项目名称:ibrdtn,代码行数:35,代码来源:AbstractWorker.cpp


示例13: n

		void DiscoveryAgent::onBeaconReceived(const DiscoveryBeacon &beacon)
		{
			// ignore own beacons
			if (beacon.getEID() == dtn::core::BundleCore::local) return;

			// convert the announcement into NodeEvents
			Node n(beacon.getEID());

			const std::list<DiscoveryService> &services = beacon.getServices();

			for (std::list<DiscoveryService>::const_iterator iter = services.begin(); iter != services.end(); ++iter)
			{
				const dtn::data::Number to_value = _config.timeout();

				const DiscoveryService &s = (*iter);

				// get protocol from tag
				const dtn::core::Node::Protocol p = s.getProtocol();

				if (p == dtn::core::Node::CONN_EMAIL)
				{
					// Set timeout
					dtn::data::Number to_value_mailcl = to_value;
					size_t configTime = dtn::daemon::Configuration::getInstance().getEMail().getNodeAvailableTime();
					if(configTime > 0)
						to_value_mailcl = configTime;

					n.add(Node::URI(Node::NODE_DISCOVERED, Node::CONN_EMAIL, s.getParameters(), to_value_mailcl, 20));
				}
				else if ((p == dtn::core::Node::CONN_UNSUPPORTED) || (p == dtn::core::Node::CONN_UNDEFINED))
				{
					n.add(Node::Attribute(Node::NODE_DISCOVERED, s.getName(), s.getParameters(), to_value, 20));
				}
				else
				{
					n.add(Node::URI(Node::NODE_DISCOVERED, p, s.getParameters(), to_value, 20));
				}
			}

			// announce NodeInfo to ConnectionManager
			dtn::core::BundleCore::getInstance().getConnectionManager().updateNeighbor(n);

			// if continuous announcements are disabled, then reply to this message
			if (!_config.announce())
			{
				// first check if another announcement was sent during the same seconds
				const dtn::data::Timestamp ts = dtn::utils::Clock::getMonotonicTimestamp();

				if (_last_announce_sent != ts)
				{
					IBRCOMMON_LOGGER_DEBUG_TAG("DiscoveryAgent", 55) << "reply with discovery beacon" << IBRCOMMON_LOGGER_ENDL;

					// reply with an own announcement
					onAdvertise();

					// remember timestamp of last sent discovery
					_last_announce_sent = ts;
				}
			}
		}
开发者ID:adoniscyp,项目名称:ibrdtn,代码行数:60,代码来源:DiscoveryAgent.cpp


示例14: throw

void DatagramConnection::setup() throw ()
{
    IBRCOMMON_LOGGER_DEBUG_TAG(DatagramConnection::TAG, 40) << "setup()" << IBRCOMMON_LOGGER_ENDL;

    _callback.connectionUp(this);
    _sender.start();
}
开发者ID:pipboy20k,项目名称:ibrdtn,代码行数:7,代码来源:DatagramConnection.cpp


示例15: catch

		void IPNDAgent::send(const DiscoveryAnnouncement &a, const ibrcommon::vinterface &iface, const ibrcommon::vaddress &addr)
		{
			// serialize announcement
			stringstream ss; ss << a;
			const std::string data = ss.str();

			ibrcommon::socketset fds = _send_socket.get(iface);

			// send out discovery announcements on all bound sockets
			// (hopefully only one per interface)
			for (ibrcommon::socketset::const_iterator iter = fds.begin(); iter != fds.end(); ++iter)
			{
				ibrcommon::udpsocket &sock = dynamic_cast<ibrcommon::udpsocket&>(**iter);

				try {
					// prevent broadcasting in the wrong address family
					if (addr.family() != sock.get_family()) continue;

					sock.sendto(data.c_str(), data.length(), 0, addr);
				} catch (const ibrcommon::socket_exception &e) {
					IBRCOMMON_LOGGER_DEBUG_TAG(IPNDAgent::TAG, 5) << "can not send message to " << addr.toString() << " via " << sock.get_address().toString() << "/" << iface.toString() << "; socket exception: " << e.what() << IBRCOMMON_LOGGER_ENDL;
				} catch (const ibrcommon::vaddress::address_exception &ex) {
					IBRCOMMON_LOGGER_TAG(IPNDAgent::TAG, warning) << ex.what() << IBRCOMMON_LOGGER_ENDL;
				}
			}
		}
开发者ID:githubuser-firas,项目名称:ibrdtn,代码行数:26,代码来源:IPNDAgent.cpp


示例16: l

		void MemoryBundleStorage::store(const dtn::data::Bundle &bundle)
		{
			ibrcommon::MutexLock l(_bundleslock);

			if (_faulty) return;

			// get size of the bundle
			dtn::data::DefaultSerializer s(std::cout);
			dtn::data::Length size = s.getLength(bundle);

			// increment the storage size
			allocSpace(size);

			// insert Container
			pair<set<dtn::data::Bundle>::iterator,bool> ret = _bundles.insert( bundle );

			if (ret.second)
			{
				const dtn::data::MetaBundle m = dtn::data::MetaBundle::create(bundle);
				_list.add(m);
				_priority_index.insert(m);

				_bundle_lengths[m] = size;

				// raise bundle added event
				eventBundleAdded(m);
			}
			else
			{
				// free the previously allocated space
				freeSpace(size);

				IBRCOMMON_LOGGER_DEBUG_TAG(MemoryBundleStorage::TAG, 5) << "got bundle duplicate " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;
			}
		}
开发者ID:abrahammartin,项目名称:ibrdtn,代码行数:35,代码来源:MemoryBundleStorage.cpp


示例17: throw

		dtn::data::MetaBundle Registration::receiveMetaBundle() throw (dtn::storage::NoBundleFoundException)
		{
			ibrcommon::MutexLock l(_receive_lock);

			while(true)
			{
				try {
					// get the first bundle in the queue
					dtn::data::MetaBundle b = _queue.pop();
					return b;
				} catch (const ibrcommon::QueueUnblockedException &e) {
					if (e.reason == ibrcommon::QueueUnblockedException::QUEUE_ABORT)
					{
						IBRCOMMON_LOGGER_DEBUG_TAG(Registration::TAG, 25) << "search for more bundles" << IBRCOMMON_LOGGER_ENDL;

						// query for new bundles
						underflow();
					}
				}
				catch(const dtn::storage::NoBundleFoundException & ){
				}
			}

			throw dtn::storage::NoBundleFoundException();
		}
开发者ID:danieldelacasa,项目名称:ibrdtn,代码行数:25,代码来源:Registration.cpp


示例18: shouldAdd

				virtual bool shouldAdd(const dtn::data::MetaBundle &meta) const throw (dtn::storage::BundleSelectorException)
				{
					// filter fragments if requested
					if (meta.isFragment() && _fragment_filter)
					{
						return false;
					}

					if (_endpoints.find(meta.destination) == _endpoints.end())
					{
						return false;
					}

					// filter own bundles
					if (!_loopback)
					{
						if (_endpoints.find(meta.source) != _endpoints.end())
						{
							return false;
						}
					}

					IBRCOMMON_LOGGER_DEBUG_TAG(Registration::TAG, 30) << "search bundle in the list of delivered bundles: " << meta.toString() << IBRCOMMON_LOGGER_ENDL;

					if (_queue.has(meta))
					{
						return false;
					}

					return true;
				};
开发者ID:danieldelacasa,项目名称:ibrdtn,代码行数:31,代码来源:Registration.cpp


示例19: IBRCOMMON_LOGGER_DEBUG_TAG

		void Clock::setRating(double val)
		{
			_rating = val;

			// debug quality of time
			IBRCOMMON_LOGGER_DEBUG_TAG("Clock", 25) << "new clock rating is " << std::setprecision(16) << val << IBRCOMMON_LOGGER_ENDL;
		}
开发者ID:lianglz2008,项目名称:ibrdtn,代码行数:7,代码来源:Clock.cpp


示例20: l

		void NeighborDatabase::NeighborEntry::releaseTransfer(const dtn::data::BundleID &id)
		{
			ibrcommon::MutexLock l(_transit_lock);
			_transit_bundles.erase(id);

			IBRCOMMON_LOGGER_DEBUG_TAG("NeighborDatabase", 20) << "release transfer of " << id.toString() << " (" << _transit_bundles.size() << " bundles in transit)" << IBRCOMMON_LOGGER_ENDL;
		}
开发者ID:aayushjr,项目名称:ibrdtn,代码行数:7,代码来源:NeighborDatabase.cpp



注:本文中的IBRCOMMON_LOGGER_DEBUG_TAG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IBRCOMMON_LOGGER_TAG函数代码示例发布时间:2022-05-30
下一篇:
C++ IBLOCK函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap