def listening(self): # TODO: must be disconnected? with self._connlock: if self._listening is None: return False return _util.is_locked(self._listening)
def connected(self): # may send responses/events with self._connlock: return _util.is_locked(self._connected)