38 #include <condition_variable> 40 class EMANE::FlowControlClient::Implementation
44 rTransport_(transport),
46 u16TokensAvailable_{}{}
52 std::lock_guard<std::mutex> m(mutex_);
60 std::lock_guard<std::mutex> m(mutex_);
71 std::unique_lock<std::mutex> lock{mutex_};
77 while(u16TokensAvailable_ == 0 && !bCancel_)
94 --u16TokensAvailable_;
97 return {u16TokensAvailable_,bStatus};
102 std::lock_guard<std::mutex> m(mutex_);
104 u16TokensAvailable_ = pMessage->getTokens();
119 std::condition_variable cond_;
121 std::uint16_t u16TokensAvailable_;
125 pImpl_{
new Implementation{transport}}
149 return pImpl_->removeToken();
155 return pImpl_->processFlowControlMessage(pMessage);
void processFlowControlMessage(const Controls::FlowControlControlMessage *pMsg)
static FlowControlControlMessage * create(const Serialization &serialization)
Flow Control Control Messages are sent between a MAC layer and a transport in order to communicate da...
std::pair< std::uint16_t, bool > removeToken()
UpstreamTransport allows for processing upstream data and control messages. Upstream packets and cont...
FlowControlClient(EMANE::UpstreamTransport &transport)