summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/SessionState.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-10-29 16:50:45 +0000
committerAlan Conway <aconway@apache.org>2007-10-29 16:50:45 +0000
commitbcf9c194c3d777fff7f776af25379d8a44f012aa (patch)
treee9e1afe41970e8f295d91b773379844d9258cc65 /cpp/src/qpid/framing/SessionState.h
parent0276d542a50b079a94132b2532b5cd016853006b (diff)
downloadqpid-python-bcf9c194c3d777fff7f776af25379d8a44f012aa.tar.gz
##-*-text-*-
Added qpidd --ack option to set ack/solicit-ack interval. 0 disabled acks. Sessions with 0 timeout never ack and don't store replay frames. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@589731 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/SessionState.h')
-rw-r--r--cpp/src/qpid/framing/SessionState.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/cpp/src/qpid/framing/SessionState.h b/cpp/src/qpid/framing/SessionState.h
index 66fc083d3f..361c960db1 100644
--- a/cpp/src/qpid/framing/SessionState.h
+++ b/cpp/src/qpid/framing/SessionState.h
@@ -35,12 +35,11 @@ namespace framing {
/**
* Session state common to client and broker.
- * Implements session ack/resume protcools.
+ * Stores replay frames, implements session ack/resume protcools.
*
* A SessionState is always associated with an _open_ session (attached or
* suspended) it is destroyed when the session is closed.
*
- * A template to make it protocol independent and easy to test.
*/
class SessionState
{
@@ -58,9 +57,16 @@ class SessionState
*Create a newly opened active session.
*@param ackInterval send/solicit an ack whenever N unacked frames
* have been received/sent.
- *@pre ackInterval > 0
+ *
+ * N=0 disables voluntary send/solict ack.
+ */
+ SessionState(uint32_t ackInterval, const framing::Uuid& id=framing::Uuid(true));
+
+ /**
+ * Create a non-resumable session. Does not store session frames,
+ * never volunteers ack or solicit-ack.
*/
- SessionState(uint32_t ackInterval=1, const framing::Uuid& id=framing::Uuid(true));
+ SessionState(const framing::Uuid& id=framing::Uuid(true));
const framing::Uuid& getId() const { return id; }
State getState() const { return state; }
@@ -103,6 +109,7 @@ class SessionState
SequenceNumber getLastSent() const { return lastSent; }
SequenceNumber getLastReceived() const { return lastReceived; }
+
private:
typedef std::deque<AMQFrame> Unacked;
@@ -110,6 +117,7 @@ class SessionState
State state;
framing::Uuid id;
+
Unacked unackedOut;
SequenceNumber lastReceived;
SequenceNumber lastSent;
@@ -118,6 +126,7 @@ class SessionState
SequenceNumber solicitAckAt;
bool ackSolicited;
bool suspending;
+ bool resumable;
};