| 131 | } |
| 132 | |
| 133 | session connection::default_session() { |
| 134 | connection_context& ctx = connection_context::get(pn_object()); |
| 135 | if (!ctx.default_session) { |
| 136 | // Note we can't use a proton::session here because we don't want to own |
| 137 | // a session reference. The connection owns the session, owning it here as well |
| 138 | // would create a circular ownership. |
| 139 | ctx.default_session = pn_session(pn_object()); |
| 140 | pn_session_open(ctx.default_session); |
| 141 | } |
| 142 | return make_wrapper(ctx.default_session); |
| 143 | } |
| 144 | |
| 145 | sender connection::open_sender(const std::string &addr) { |
| 146 | return open_sender(addr, sender_options()); |