本文整理汇总了C++中proton::event::link方法的典型用法代码示例。如果您正苦于以下问题:C++ event::link方法的具体用法?C++ event::link怎么用?C++ event::link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类proton::event
的用法示例。
在下文中一共展示了event::link方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_link_close
void on_link_close(proton::event &e) {
proton::link lnk = e.link();
if (!!lnk.sender()) {
unsubscribe(lnk.sender());
}
}
示例2: on_sendable
void on_sendable(proton::event &e) {
proton::link lnk = e.link();
std::string address = lnk.local_source().address();
proton::sender s = lnk.sender();
queues_.get(address).dispatch(&s);
}
示例3: on_link_opening
void on_link_opening(proton::event &e) {
proton::link& lnk = e.link();
if (lnk.is_sender()) {
proton::sender &sender(lnk.sender());
proton::terminus &remote_source(lnk.remote_source());
if (remote_source.is_dynamic()) {
std::string address = queue_name();
lnk.source().address(address);
queue *q = new queue(true);
queues[address] = q;
q->subscribe(sender);
std::cout << "broker dynamic outgoing link from " << address << std::endl;
}
else {
std::string address = remote_source.address();
if (!address.empty()) {
lnk.source().address(address);
get_queue(address).subscribe(sender);
std::cout << "broker outgoing link from " << address << std::endl;
}
}
}
else {
std::string address = lnk.remote_target().address();
if (!address.empty())
lnk.target().address(address);
std::cout << "broker incoming link to " << address << std::endl;
}
}
示例4: on_link_open
void on_link_open(proton::event &e) {
proton::link lnk = e.link();
if (!!lnk.sender()) {
proton::terminus remote_source(lnk.remote_source());
queue &q = remote_source.dynamic() ?
queues_.dynamic() : queues_.get(remote_source.address());
lnk.local_source().address(q.name());
q.subscribe(lnk.sender());
std::cout << "broker outgoing link from " << q.name() << std::endl;
} else {
// Receiver
std::string address = lnk.remote_target().address();
if (!address.empty()) {
lnk.local_target().address(address);
std::cout << "broker incoming link to " << address << std::endl;
}
}
}
示例5: on_message
void on_message(proton::event &e) {
std::string address = e.link().local_target().address();
queues_.get(address).publish(e.message(), e.link().receiver());
}
示例6: on_link_open
void on_link_open(proton::event &e) {
if (e.link() == receiver)
send_request();
}
示例7: on_link_opened
void on_link_opened(proton::event &e) {
if (&e.link() == receiver.get())
send_request();
}
示例8: on_message
void on_message(proton::event &e) {
std::string addr = e.link().target().address();
get_queue(addr).publish(e.message());
}
示例9: on_sendable
void on_sendable(proton::event &e) {
proton::link& lnk = e.link();
std::string addr = lnk.source().address();
proton::sender &s(lnk.sender());
get_queue(addr).dispatch(&s);
}
示例10: on_link_closing
void on_link_closing(proton::event &e) {
proton::link &lnk = e.link();
if (lnk.is_sender()) {
unsubscribe(lnk.sender());
}
}