MCPcopy Create free account
hub / github.com/apache/qpid-proton / on_link_flow

Function on_link_flow

cpp/src/messaging_adapter.cpp:67–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66
67void on_link_flow(messaging_handler& handler, pn_event_t* event) {
68 pn_link_t *lnk = pn_event_link(event);
69 // TODO: process session flow data, if no link-specific data, just return.
70 if (!lnk) return;
71 int state = pn_link_state(lnk);
72 if ((state&PN_LOCAL_ACTIVE) && (state&PN_REMOTE_ACTIVE)) {
73 link_context& lctx = link_context::get(lnk);
74 if (pn_link_is_sender(lnk)) {
75 if (pn_link_credit(lnk) > 0) {
76 sender s(make_wrapper<sender>(lnk));
77 bool draining = pn_link_get_drain(lnk);
78 if ( draining && !lctx.draining) {
79 handler.on_sender_drain_start(s);
80 }
81 lctx.draining = draining;
82 // create on_message extended event
83 handler.on_sendable(s);
84 }
85 } else {
86 // receiver
87 if (!pn_link_credit(lnk) && lctx.draining) {
88 lctx.draining = false;
89 pn_link_set_drain(lnk, false);
90 receiver r(make_wrapper<receiver>(lnk));
91 handler.on_receiver_drain_finish(r);
92 }
93 credit_topup(lnk);
94 }
95 }
96}
97
98// Decode the message corresponding to a delivery from a link.
99void message_decode(message& msg, proton::delivery delivery) {

Callers 1

dispatchMethod · 0.85

Calls 11

pn_event_linkFunction · 0.85
pn_link_stateFunction · 0.85
pn_link_is_senderFunction · 0.85
pn_link_creditFunction · 0.85
pn_link_get_drainFunction · 0.85
pn_link_set_drainFunction · 0.85
credit_topupFunction · 0.85
getFunction · 0.70
on_sender_drain_startMethod · 0.45
on_sendableMethod · 0.45

Tested by

no test coverage detected