7 #include <boost/foreach.hpp>
17 : connection_(connection), rx_message_trace_cb_(NULL),
18 tx_message_trace_cb_(NULL) {
46 tbb::mutex::scoped_lock lock(
mutex_);
48 WriteReadyCbMap::iterator iter =
map_.begin();
49 WriteReadyCbMap::iterator next = iter;
50 for (; iter !=
map_.end(); iter = next) {
63 tbb::mutex::scoped_lock lock(
mutex_);
85 rxmap_.insert(make_pair(
id, cb));
89 ReceiveCbMap::iterator it =
rxmap_.find(
id);
120 vector<string> receivers;
121 for (
const auto& value :
rxmap_) {
131 map_.insert(make_pair(
id, cb));
183 ReceiveCbMap::iterator iter =
rxmap_.begin();
184 for (; iter !=
rxmap_.end(); ++iter) {
261 const std::string &msg,
272 const std::string &msg,
const std::string & FromString() const
virtual uint32_t rx_keepalive() const
virtual std::string LastStateName() const
virtual void UnRegisterWriteReady(xmps::PeerId id)
virtual const std::string last_flap_at() const =0
std::string StateName() const
virtual uint32_t FlapCount() const
virtual xmps::PeerState GetPeerState() const
virtual void RegisterReceive(xmps::PeerId, ReceiveCb)
virtual uint32_t tx_open() const
virtual void ProcessXmppMessage(const XmppStanza::XmppMessage *msg)
virtual std::string LastEvent() const
virtual std::string StateName() const
virtual void RegisterRxMessageTraceCallback(RxMessageTraceCb cb)
boost::function< void(const boost::system::error_code &)> SendReadyCb
virtual bool Send(const uint8_t *msg, size_t msg_size, xmps::PeerId id, SendReadyCb cb)
std::vector< std::string > GetReceiverList() const
uint32_t tx_update() const
std::string endpoint_string() const
virtual void UnRegisterReferer(xmps::PeerId)
virtual int GetTaskInstance() const
bool MatchCallback(string to, xmps::PeerId peer)
tbb::atomic< time_t > last_received_
RxMessageTraceCb rx_message_trace_cb_
virtual std::string PeerAddress() const
virtual uint32_t rx_update() const
std::string LastStateName() const
virtual std::string AuthType() const
boost::function< bool(const std::string &, int, int, const std::string &, const XmppStanza::XmppMessage *msg) > RxMessageTraceCb
virtual uint32_t tx_close() const
virtual uint32_t rx_open() const
virtual void UnRegisterReceive(xmps::PeerId)
XmppConnection * connection_
bool Send(const uint8_t *data, size_t size, const std::string *msg_str=NULL)
void HandleStateEvent(xmsm::XmState state)
void NotifyConnectionEvent(XmppChannelMux *, xmps::PeerState)
virtual ~XmppChannelMux()
virtual uint32_t tx_keepalive() const
std::string LastEvent() const
virtual uint32_t rx_close() const
virtual void RetryDelete()=0
#define CHECK_CONCURRENCY(...)
static const char * kDnsPeer
virtual void RegisterReferer(xmps::PeerId)
xmsm::XmState GetStateMcState() const
std::string GetXmppAuthenticationType() const
string PeerIdToName(PeerId id)
const std::string & ToString() const
virtual void RegisterTxMessageTraceCallback(TxMessageTraceCb cb)
void WriteReady(const boost::system::error_code &ec)
virtual uint32_t flap_count() const =0
int GetTaskInstance() const
void RegisterWriteReady(xmps::PeerId, SendReadyCb)
virtual bool LastSent(time_t duration) const
static time_t UTCTimestamp()
virtual std::string LastStateChangeAt() const
boost::function< bool(const std::string &, int, int, const std::string &, const XmppStanza::XmppMessage *msg) > TxMessageTraceCb
virtual bool LastReceived(time_t duration) const
std::string LastStateChangeAt() const
XmppChannelMux(XmppConnection *)
boost::function< void(const XmppStanza::XmppMessage *, xmps::PeerState state) > ReceiveCb
size_t RefererCount() const
virtual std::string LastFlap() const
static const char * kConfigPeer
void NotifyConnectionEvent(XmppChannelMux *, xmps::PeerState)
size_t ReceiverCount() const
virtual uint32_t tx_update() const
uint32_t rx_close() const
XmppStateMachine * state_machine()
virtual const std::string & ToString() const
bool IsGRHelperModeEnabled() const
bool TxMessageTrace(const std::string &to_address, int port, int msg_size, const std::string &msg, const XmppStanza::XmppMessage *xmpp_msg)
static const char * kBgpPeer
TxMessageTraceCb tx_message_trace_cb_
bool RxMessageTrace(const std::string &to_address, int port, int msg_size, const std::string &msg, const XmppStanza::XmppMessage *xmpp_msg)
uint32_t rx_update() const
static const char * kOtherPeer
tbb::atomic< time_t > last_sent_
uint32_t tx_keepalive() const
uint32_t tx_close() const
uint32_t rx_keepalive() const
virtual const std::string & FromString() const