summaryrefslogtreecommitdiff
path: root/cpp/lib/client
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-01-31 19:07:04 +0000
committerAlan Conway <aconway@apache.org>2007-01-31 19:07:04 +0000
commit9cdf50e9bbf4aae222600245691f9b1d3acb3147 (patch)
tree0784a9860824c0d144e1615ad1f655ac2dea5916 /cpp/lib/client
parent754f8903943233604661b91b53defe39120e6ad5 (diff)
downloadqpid-python-9cdf50e9bbf4aae222600245691f9b1d3acb3147.tar.gz
* framing/ChannelAdapter.cpp: Enable channel state assertions.
* common/Exception & others: Exception template constructors that accept any object that supports ostream operator<< as messages. E.g. can pass a boost::format object directly, no need to call str(). * Fixed up various exception messges to use boost::format. * framing/Requester.cpp: Exception on invalid response id. * client/Connection.h: Remove extra getVersion() function. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@501948 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/client')
-rw-r--r--cpp/lib/client/Connection.cpp4
-rw-r--r--cpp/lib/client/Connection.h6
-rw-r--r--cpp/lib/client/ResponseHandler.cpp6
3 files changed, 4 insertions, 12 deletions
diff --git a/cpp/lib/client/Connection.cpp b/cpp/lib/client/Connection.cpp
index 78e340eb11..0b2859387f 100644
--- a/cpp/lib/client/Connection.cpp
+++ b/cpp/lib/client/Connection.cpp
@@ -32,7 +32,6 @@
using namespace qpid::framing;
using namespace qpid::sys;
-using namespace qpid::sys;
namespace qpid {
@@ -101,7 +100,6 @@ void Connection::close(
}
}
-// FIXME aconway 2007-01-26: make channels owned and created by connection?
void Connection::openChannel(Channel& channel) {
ChannelId id = ++channelIdCounter;
assert (channels.find(id) == channels.end());
@@ -115,7 +113,6 @@ void Connection::erase(ChannelId id) {
}
void Connection::received(AMQFrame* frame){
- // FIXME aconway 2007-01-25: Mutex
ChannelId id = frame->getChannel();
Channel* channel = channels[id];
// FIXME aconway 2007-01-26: Exception thrown here is hanging the
@@ -149,7 +146,6 @@ void Connection::channelException(
}
void Connection::idleIn(){
- std::cout << "Connection timed out due to abscence of heartbeat." << std::endl;
connector->close();
}
diff --git a/cpp/lib/client/Connection.h b/cpp/lib/client/Connection.h
index 6a9a76eed2..57286092af 100644
--- a/cpp/lib/client/Connection.h
+++ b/cpp/lib/client/Connection.h
@@ -88,7 +88,7 @@ class Connection : public ConnectionForChannel
static framing::ChannelId channelIdCounter;
static const std::string OK;
-
+
framing::ProtocolVersion version;
const u_int32_t max_frame_size;
ChannelMap channels;
@@ -107,8 +107,6 @@ class Connection : public ConnectionForChannel
friend class Channel;
public:
- const framing::ProtocolVersion& getVersion() const { return version; }
-
/**
* Creates a connection object, but does not open the
* connection.
@@ -187,7 +185,7 @@ class Connection : public ConnectionForChannel
inline u_int32_t getMaxFrameSize(){ return max_frame_size; }
/** @return protocol version in use on this connection. */
- const framing::ProtocolVersion& getVersion() { return version; }
+ const framing::ProtocolVersion& getVersion() const { return version; }
};
}} // namespace qpid::client
diff --git a/cpp/lib/client/ResponseHandler.cpp b/cpp/lib/client/ResponseHandler.cpp
index 8950138f5e..ea234ac321 100644
--- a/cpp/lib/client/ResponseHandler.cpp
+++ b/cpp/lib/client/ResponseHandler.cpp
@@ -66,10 +66,8 @@ void ResponseHandler::receive(ClassId c, MethodId m) {
if(!validate(response->amqpClassId(), response->amqpMethodId())) {
THROW_QPID_ERROR(
PROTOCOL_ERROR,
- (boost::format(
- "Expected class:method %d:%d, got %d:%d")
- % c % m % response->amqpClassId() % response->amqpMethodId()
- ).str());
+ boost::format("Expected class:method %d:%d, got %d:%d")
+ % c % m % response->amqpClassId() % response->amqpMethodId());
}
}