From 3e0f90a2ac7d708ef693a255a9ed4feafffb2131 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Thu, 24 Jul 2008 04:42:51 +0000 Subject: Refactor to change client connector state machine to be held in ConnectionHandler git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@679268 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ConnectionHandler.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cpp/src/qpid/client/ConnectionHandler.cpp') diff --git a/cpp/src/qpid/client/ConnectionHandler.cpp b/cpp/src/qpid/client/ConnectionHandler.cpp index 05f6bb9733..22ebec76bf 100644 --- a/cpp/src/qpid/client/ConnectionHandler.cpp +++ b/cpp/src/qpid/client/ConnectionHandler.cpp @@ -186,3 +186,14 @@ void ConnectionHandler::closeOk() } setState(CLOSED); } + +bool ConnectionHandler::isOpen() const +{ + return getState() == OPEN; +} + +bool ConnectionHandler::isClosed() const +{ + int s = getState(); + return s == CLOSING || s == CLOSED || s == FAILED; +} -- cgit v1.2.1