summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/SessionImpl.h
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-01-27 21:17:47 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-01-27 21:17:47 +0000
commit2dff9493ceb62d37a3b70a4abd6bc0539bdb581e (patch)
tree0003c4766da8f32e8fc2b9f5b4968391b7319492 /cpp/src/qpid/client/SessionImpl.h
parent3f547381f1af5cdb9d7c5f9cc30f7303d643afd9 (diff)
downloadqpid-python-2dff9493ceb62d37a3b70a4abd6bc0539bdb581e.tar.gz
Producer side rate throttling:
This uses the Message.Flow command to send credit from broker to client to ensure that the client doesn't exceed a rate configured on the broker per session. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@738247 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/SessionImpl.h')
-rw-r--r--cpp/src/qpid/client/SessionImpl.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/cpp/src/qpid/client/SessionImpl.h b/cpp/src/qpid/client/SessionImpl.h
index ea7776634a..9d0c4ff796 100644
--- a/cpp/src/qpid/client/SessionImpl.h
+++ b/cpp/src/qpid/client/SessionImpl.h
@@ -61,7 +61,8 @@ class SessionHandler;
class SessionImpl : public framing::FrameHandler::InOutHandler,
public Execution,
private framing::AMQP_ClientOperations::SessionHandler,
- private framing::AMQP_ClientOperations::ExecutionHandler
+ private framing::AMQP_ClientOperations::ExecutionHandler,
+ private framing::AMQP_ClientOperations::MessageHandler
{
public:
SessionImpl(const std::string& name, shared_ptr<ConnectionImpl>);
@@ -123,6 +124,7 @@ private:
};
typedef framing::AMQP_ClientOperations::SessionHandler SessionHandler;
typedef framing::AMQP_ClientOperations::ExecutionHandler ExecutionHandler;
+ typedef framing::AMQP_ClientOperations::MessageHandler MessageHandler;
typedef sys::StateMonitor<State, DETACHED> StateMonitor;
typedef StateMonitor::Set States;
@@ -138,6 +140,7 @@ private:
void handleIn(framing::AMQFrame& frame);
void handleOut(framing::AMQFrame& frame);
+ void handleContentOut(framing::AMQFrame& frame);
/**
* Sends session controls. This case is treated slightly
* differently than command frames sent by the application via
@@ -181,6 +184,18 @@ private:
uint8_t fieldIndex,
const std::string& description,
const framing::FieldTable& errorInfo);
+
+ // Note: Following methods are called by network thread in
+ // response to message commands from the broker
+ // EXCEPT Message.Transfer
+ void accept(const qpid::framing::SequenceSet&);
+ void reject(const qpid::framing::SequenceSet&, uint16_t, const std::string&);
+ void release(const qpid::framing::SequenceSet&, bool);
+ qpid::framing::MessageResumeResult resume(const std::string&, const std::string&);
+ void setFlowMode(const std::string&, uint8_t);
+ void flow(const std::string&, uint8_t, uint32_t);
+ void stop(const std::string&);
+
sys::ExceptionHolder exceptionHolder;
mutable StateMonitor state;
@@ -211,6 +226,9 @@ private:
SessionState sessionState;
+ // Only keep track of message credit
+ sys::Semaphore* sendMsgCredit;
+
friend class client::SessionHandler;
};