예제 #1
0
    void on_link_close(proton::event &e) {
        proton::link lnk = e.link();

        if (!!lnk.sender()) {
            unsubscribe(lnk.sender());
        }
    }
예제 #2
0
    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
0
파일: broker.cpp 프로젝트: Karm/qpid-proton
 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
0
    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
0
 void on_message(proton::event &e) {
     std::string address = e.link().local_target().address();
     
     queues_.get(address).publish(e.message(), e.link().receiver());
 }
예제 #6
0
 void on_link_open(proton::event &e) {
     if (e.link() == receiver)
         send_request();
 }
예제 #7
0
파일: client.cpp 프로젝트: Karm/qpid-proton
 void on_link_opened(proton::event &e) {
     if (&e.link() == receiver.get())
         send_request();
 }
예제 #8
0
파일: broker.cpp 프로젝트: Karm/qpid-proton
 void on_message(proton::event &e) {
     std::string addr = e.link().target().address();
     get_queue(addr).publish(e.message());
 }
예제 #9
0
파일: broker.cpp 프로젝트: Karm/qpid-proton
 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
0
파일: broker.cpp 프로젝트: Karm/qpid-proton
 void on_link_closing(proton::event &e) {
     proton::link &lnk = e.link();
     if (lnk.is_sender()) {
         unsubscribe(lnk.sender());
     }
 }