qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: How can I tell if a Session is closed?
Date Mon, 22 Aug 2011 16:30:11 GMT
On 08/22/2011 07:43 AM, Toralf Lund wrote:
> Is there any way to tell if close() has been called on an
> qpid::messaging::Session (in the C++ API)? There is no isClosed() or
> isOpen() method on this class... It does seem like isError() will be
> set, but can I rely on this? And how can I distinguish between a closed
> session and a session with send(er) or receiver(er) error?
> Related question: Do I need to close a session where an error has been
> raised and isError() is true, or can I safely throw away the reference
> without getting memory leaks? (If I can, I don't really need to know if
> close() has been called.)

The connection holds a list of associated sessions and an error does not 
cause the session to be removed. It is therefore best to close the 
session, ending the association with the connection.

I agree that an isOpen() method or equivalent on the session would be 

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org

View raw message