def _cleanSessions(self, conn): ssn = proton.pn_session_head(conn, (proton.PN_LOCAL_ACTIVE | proton.PN_REMOTE_CLOSED)) while ssn: self.log.debug("Closing Session") proton.pn_session_close(ssn) ssn = proton.pn_session_next(ssn, (proton.PN_LOCAL_ACTIVE | proton.PN_REMOTE_CLOSED))
def _cleanSessions(self, conn): ssn = proton.pn_session_head( conn, (proton.PN_LOCAL_ACTIVE | proton.PN_REMOTE_CLOSED)) while ssn: self.log.debug("Closing Session") proton.pn_session_close(ssn) ssn = proton.pn_session_next( ssn, (proton.PN_LOCAL_ACTIVE | proton.PN_REMOTE_CLOSED))
def _openPendingSessions(self, conn, connector): ssn = proton.pn_session_head(conn, proton.PN_LOCAL_UNINIT) while ssn: proton.pn_session_open(ssn) ctx = ProtonClient(self, conn, connector, ssn, None) l = proton.pn_connector_listener(connector) listener = proton.pn_listener_context(l) listener._acceptHandler(listener, ctx) proton.pn_session_set_context(ssn, ctx) self.log.debug("Session Opened.") ssn = proton.pn_session_next(ssn, proton.PN_LOCAL_UNINIT)
def _iterSessions(self, conn, flags): ssn = proton.pn_session_head(conn, flags) while ssn: yield ssn ssn = proton.pn_session_next(ssn, flags)