summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/ConnectionHandler.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-01-13 19:08:29 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-01-13 19:08:29 +0000
commit5fec8f487c510e2309b3bc939fea70078a11af97 (patch)
treef875a150066a08094eba72856de99e471185a0aa /cpp/src/qpid/broker/ConnectionHandler.cpp
parent77bde150020c6c34130523f528d739c264aa12e3 (diff)
downloadqpid-python-5fec8f487c510e2309b3bc939fea70078a11af97.tar.gz
Send heartbeat from broker to client
- Server sends possible heartbeat range and client replies with desired heartbeat as part of the tune-tuneOk exchange git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@734220 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/ConnectionHandler.cpp')
-rw-r--r--cpp/src/qpid/broker/ConnectionHandler.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/ConnectionHandler.cpp b/cpp/src/qpid/broker/ConnectionHandler.cpp
index 6f99b60cd8..38e667dcba 100644
--- a/cpp/src/qpid/broker/ConnectionHandler.cpp
+++ b/cpp/src/qpid/broker/ConnectionHandler.cpp
@@ -52,6 +52,11 @@ void ConnectionHandler::close(connection::CloseCode code, const string& text)
handler->client.close(code, text);
}
+void ConnectionHandler::heartbeat()
+{
+ handler->client.heartbeat();
+}
+
void ConnectionHandler::handle(framing::AMQFrame& frame)
{
AMQMethodBody* method=frame.getBody()->getMethod();
@@ -157,7 +162,7 @@ void ConnectionHandler::Handler::tuneOk(uint16_t /*channelmax*/,
uint16_t framemax, uint16_t heartbeat)
{
connection.setFrameMax(framemax);
- connection.setHeartbeat(heartbeat);
+ connection.setHeartbeatInterval(heartbeat);
}
void ConnectionHandler::Handler::open(const string& /*virtualHost*/,
@@ -194,6 +199,11 @@ void ConnectionHandler::Handler::closeOk(){
connection.getOutput().close();
}
+void ConnectionHandler::Handler::heartbeat(){
+ // Do nothing - the purpose of heartbeats is just to make sure that there is some
+ // traffic on the connection within the heart beat interval, we check for the
+ // traffic and don't need to do anything in response to heartbeats
+}
void ConnectionHandler::Handler::start(const FieldTable& serverProperties,
const framing::Array& /*mechanisms*/,