handle state changes of the endpoints
| 54 | |
| 55 | // handle state changes of the endpoints |
| 56 | static void process_endpoints(pn_connection_t *conn) { |
| 57 | pn_session_t *ssn = pn_session_head(conn, PN_LOCAL_UNINIT); |
| 58 | while (ssn) { |
| 59 | // fprintf(stderr, "Opening session %p\n", (void*)ssn); |
| 60 | pn_session_open(ssn); |
| 61 | ssn = pn_session_next(ssn, PN_LOCAL_UNINIT); |
| 62 | } |
| 63 | |
| 64 | pn_link_t *link = pn_link_head(conn, PN_LOCAL_UNINIT); |
| 65 | while (link) { |
| 66 | pn_link_open(link); |
| 67 | link = pn_link_next(link, PN_LOCAL_UNINIT); |
| 68 | } |
| 69 | |
| 70 | link = pn_link_head(conn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED); |
| 71 | while (link) { |
| 72 | pn_link_close(link); |
| 73 | link = pn_link_next(link, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED); |
| 74 | } |
| 75 | |
| 76 | ssn = pn_session_head(conn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED); |
| 77 | while (ssn) { |
| 78 | pn_session_close(ssn); |
| 79 | ssn = pn_session_next(ssn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | // bring up a session and a link between the two connections |
| 84 | static void test_setup(pn_connection_t *c1, pn_transport_t *t1, |
no test coverage detected