X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FConnectors.hh;h=e6b8c07af00c67d44e45ce232f4841876907d891;hb=d5a72d0b3f6fee56dba6de1c54cafb448ebe3457;hp=78b7023f1d6cacef07bc159c710af7c0de005019;hpb=d677b6337f001480fccd73889bab3d62e719826b;p=senf.git diff --git a/PPI/Connectors.hh b/PPI/Connectors.hh index 78b7023..e6b8c07 100644 --- a/PPI/Connectors.hh +++ b/PPI/Connectors.hh @@ -161,6 +161,8 @@ namespace connector { class Connector : ModuleManager::Initializable, boost::noncopyable { + SENF_LOG_CLASS_AREA(); + SENF_LOG_DEFAULT_LEVEL(senf::log::NOTICE); public: Connector & peer() const; ///< Get peer connected to this connector module::Module & module() const; ///< Get this connectors containing module @@ -169,11 +171,19 @@ namespace connector { void disconnect(); ///< Disconnect connector from peer + enum TraceState { NO_TRACING, TRACE_IDS, TRACE_CONTENTS }; + + static void tracing(TraceState state); + static TraceState tracing(); + protected: Connector(); virtual ~Connector(); void connect(Connector & target); + + void trace(Packet const & p, char const * label); + void throttleTrace(char const * label, char const * type); private: virtual std::type_info const & packetTypeID(); @@ -183,6 +193,8 @@ namespace connector { Connector * peer_; module::Module * module_; + static TraceState traceState_; + friend class module::Module; }; @@ -236,11 +248,11 @@ namespace connector { private: virtual void v_init(); - // Called by the routing to change the remote throttling state + // Called by the routing to change the throttling state from forwarding routes void notifyThrottle(); ///< Forward a throttle notification to this connector void notifyUnthrottle(); ///< Forward an unthrottle notification to this connector - // Internal members to emit throttling notifications + // Internal members to emit throttling notifications to the connected peer void emitThrottle(); void emitUnthrottle();