| 261 | } // namespace |
| 262 | |
| 263 | class stop_reconnect_tester : public proton::messaging_handler { |
| 264 | public: |
| 265 | stop_reconnect_tester() : |
| 266 | container_(*this, "reconnect_tester") |
| 267 | { |
| 268 | } |
| 269 | |
| 270 | void deferred_stop() { |
| 271 | container_.stop(); |
| 272 | } |
| 273 | |
| 274 | void on_container_start(proton::container &c) override { |
| 275 | proton::reconnect_options reconnect_options; |
| 276 | c.connect("this-is-not-going-to work.com", proton::connection_options().reconnect(reconnect_options)); |
| 277 | c.schedule(proton::duration::SECOND, proton::make_work(&stop_reconnect_tester::deferred_stop, this)); |
| 278 | } |
| 279 | |
| 280 | void run() { |
| 281 | container_.run(); |
| 282 | } |
| 283 | |
| 284 | private: |
| 285 | proton::container container_; |
| 286 | }; |
| 287 | |
| 288 | int test_stop_reconnect() { |
| 289 | stop_reconnect_tester().run(); |
no outgoing calls