Takes ownership of pnc NOTE: After the call to start_connection() pnc is active in a proactor thread, and may even have been freed already. It is undefined to use pnc (or any object belonging to it) except in appropriate handlers. SUBTLE NOTE: There must not be any proton::object wrappers in scope when start_connection() is called. The wrapper destructor will call pn_decref() after start_connect
| 213 | // after start_connection() which is undefined! |
| 214 | // |
| 215 | void container::impl::start_connection(const url& url, pn_connection_t *pnc) { |
| 216 | pn_transport_t* pnt = pn_transport(); |
| 217 | connection_context& cc = connection_context::get(pnc); |
| 218 | connection_options& co = *cc.connection_options_; |
| 219 | co.apply_unbound_client(pnt); |
| 220 | |
| 221 | char caddr[PN_MAX_ADDR]; |
| 222 | pn_proactor_addr(caddr, sizeof(caddr), url.host().c_str(), url.port().c_str()); |
| 223 | pn_proactor_connect2(proactor_, pnc, pnt, caddr); // Takes ownership of pnc, pnt |
| 224 | } |
| 225 | |
| 226 | void container::impl::reconnect(pn_connection_t* pnc) { |
| 227 | --reconnecting_; |
nothing calls this directly
no test coverage detected