void on_connection_open(proton::event &e) { std::cout << "Inbound server connection connected via SSL. Protocol: " << e.connection().transport().ssl().protocol() << std::endl; if (e.connection().transport().sasl().outcome() == sasl::OK) { std::string subject = e.connection().transport().ssl().remote_subject(); std::cout << "Inbound client certificate identity " << find_CN(subject) << std::endl; } else { std::cout << "Inbound client authentication failed" <<std::endl; e.connection().close(); } inbound_listener.close(); }
void on_delivery_accept(proton::event &e) { confirmed++; if (confirmed == total) { std::cout << "all messages confirmed" << std::endl; e.connection().close(); acceptor.close(); } }
void on_accepted(proton::event &e) { confirmed_++; e.delivery().settle(); if (confirmed_ == total_) { std::cout << "all messages confirmed" << std::endl; if (!replying_) e.connection().close(); } }
void on_message(proton::event &e) { std::cout << "Received " << e.message().body() << std::endl; std::string reply_to = e.message().reply_to(); proton::message reply; reply.address(reply_to); reply.body(to_upper(e.message().body().get<std::string>())); reply.correlation_id(e.message().correlation_id()); if (!senders[reply_to]) senders[reply_to] = e.connection().open_sender(reply_to); senders[reply_to].send(reply); }
void on_message(proton::event &e) { if (requests.empty()) return; // Spurious extra message! proton::message& response = e.message(); std::cout << requests.front() << " => " << response.body() << std::endl; requests.erase(requests.begin()); if (!requests.empty()) { send_request(); } else { e.connection().close(); } }
void on_message(proton::event &e) { proton::message &msg = e.message(); msg.body().decode() >> received_content_; received_bytes_ += received_content_.size(); if (received_ < total_) { received_++; } e.delivery().settle(); if (received_ == total_) { e.receiver().close(); e.connection().close(); } }
void on_message(proton::event &e) { proton::message& msg = e.message(); if (msg.id().get<uint64_t>() < received) return; // ignore duplicate if (expected == 0 || received < expected) { std::cout << msg.body() << std::endl; received++; } if (received == expected) { e.receiver().close(); e.connection().close(); if (!!acceptor) acceptor.close(); } }
void on_message ( proton::event &e ) { log ( "on_message" ); double receive_timestamp = get_timestamp(); proton::message& msg = e.message(); double send_timestamp = msg.body().get<double>(); double latency = receive_timestamp - send_timestamp; fprintf ( output_fp, "latency %.6lf\n", latency ); if ( ! received ) { rr_init ( & resource_reporter ); } if ( (expected == 0) || (expected == -1) || (received < expected) ) { received++; if ( ! ( received % report_frequency ) ) { report ( output_fp ); } if (received == expected) { log ( "closing receiver and connection." ); e.receiver().close(); e.connection().close(); char filename[1000]; sprintf ( filename, "/tmp/simple_recv_%d_is_done", getpid() ); FILE * fp = fopen ( filename, "w" ); fprintf ( fp, ":-)\n" ); fclose ( fp ); } } }
void on_start(proton::event &e) { e.connection().open(); sender = e.connection().open_sender(url.path()); receiver = e.connection().open_receiver("", proton::link_options().dynamic_address(true)); }
void on_delivery_accept(proton::event &e) { // All done. e.connection().close(); }
void on_connection_open(proton::event &e) { std::cout << "connection events going to handler_2" << std::endl; std::cout << "connection max_frame_size: " << e.connection().transport().max_frame_size() << ", idle timeout: " << e.connection().transport().idle_timeout() << std::endl; e.connection().close(); }
void on_transport_close(proton::event &e) { remove_stale_consumers(e.connection()); }
void on_connection_open(proton::event &e) { std::cout << "unexpected connection event on main handler" << std::endl; e.connection().close(); }
void on_message(proton::event &e) { std::cout << e.message().body() << std::endl; e.connection().close(); }
void on_accepted(proton::event &e) { e.connection().close(); }
void on_start(proton::event &e) { e.connection().open(); e.connection().open_receiver(address_); e.connection().open_sender(address_); }
void on_connection_open(proton::event &e) { std::string subject = e.connection().transport().ssl().remote_subject(); std::cout << "Outgoing client connection connected via SSL. Server certificate identity " << find_CN(subject) << std::endl; }
void on_disconnected(proton::event &e) { remove_stale_consumers(e.connection()); }
void on_connection_closing(proton::event &e) { remove_stale_consumers(e.connection()); }
void on_start(proton::event &e) { e.connection().open(); e.connection().open_receiver(url.path()); std::cout << "server connected to " << url << std::endl; }