本文整理汇总了C++中proton::sender::send方法的典型用法代码示例。如果您正苦于以下问题:C++ sender::send方法的具体用法?C++ sender::send怎么用?C++ sender::send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类proton::sender
的用法示例。
在下文中一共展示了sender::send方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_send
// work_queue work items is are automatically dequeued and called by proton
// This function is called because it was queued by send()
void do_send(const proton::message& m) {
sender_.send(m);
std::lock_guard<std::mutex> l(lock_);
--queued_; // work item was consumed from the work_queue
credit_ = sender_.credit(); // update credit
sender_ready_.notify_all(); // Notify senders we have space on queue
}
示例2: send_request
void send_request() {
proton::message req;
req.body(requests.front());
req.reply_to(receiver.remote_source().address());
sender.send(req);
}
示例3: do_send
// Only called if we have credit. Return true if we sent a message.
bool do_send(queue* q, proton::sender &s) {
proton::message m;
bool popped = q->pop(m, has_messages_callback_);
if (popped)
s.send(m);
/// if !popped the queue has saved the callback for later.
return popped;
}
示例4: on_sendable
void on_sendable(proton::sender &sender) override {
while (sender.credit() && sent_ < total_) {
id_value_ = sent_ + 1;
message_.correlation_id(id_value_);
message_.creation_time(proton::timestamp::now());
sender.send(message_);
sent_++;
}
}
示例5: send_available_messages
void send_available_messages(proton::sender &s) {
for (int i = sequence; available && s.credit() > 0; i++) {
std::ostringstream mbody;
mbody << "flow_sender message " << sequence++;
proton::message m(mbody.str());
s.send(m);
available--;
}
}
示例6: on_sendable
void on_sendable(proton::event &e, proton::sender &sender) override {
while (sender.credit() && sent < total) {
proton::message msg;
msg.id(sent + 1);
std::map<std::string, int> m;
m["sequence"] = sent+1;
msg.body(m);
sender.send(msg);
sent++;
}
}
示例7: on_sendable
void on_sendable(proton::event &e, proton::sender &s) override {
proton::message m;
m.body("Hello World!");
s.send(m);
s.close();
}