diff options
author | Alan Conway <aconway@apache.org> | 2008-06-04 16:00:17 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-06-04 16:00:17 +0000 |
commit | d1f99cede240ade9532da4fe5061a177c5c63f33 (patch) | |
tree | a2fd2e7ffd1d865ef28bc2e4391439844b3b1dc2 /cpp/src/qpid/SessionState.h | |
parent | 27e5e1b49cec739ee9d27ebe8b7d3a91c0f46744 (diff) | |
download | qpid-python-d1f99cede240ade9532da4fe5061a177c5c63f33.tar.gz |
Increased default flush interval to 1MB, send spontaneous known-completed at the flush interval.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@663271 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/SessionState.h')
-rw-r--r-- | cpp/src/qpid/SessionState.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cpp/src/qpid/SessionState.h b/cpp/src/qpid/SessionState.h index 40462e56e7..80d218b8bb 100644 --- a/cpp/src/qpid/SessionState.h +++ b/cpp/src/qpid/SessionState.h @@ -78,7 +78,7 @@ class SessionState { typedef boost::iterator_range<ReplayList::iterator> ReplayRange; struct Configuration { - Configuration(size_t flush=0, size_t hard=0); + Configuration(size_t flush=1024*1024, size_t hard=0); size_t replayFlushLimit; // Flush when the replay list >= N bytes. 0 disables. size_t replayHardLimit; // Kill session if replay list > N bytes. 0 disables. }; @@ -108,6 +108,12 @@ class SessionState { /** Called when flush for confirmed and completed commands is sent to peer. */ virtual void senderRecordFlush(); + /** True if we should reply to the next incoming completed command */ + virtual bool senderNeedKnownCompleted() const; + + /** Called when knownCompleted is sent to peer. */ + virtual void senderRecordKnownCompleted(); + /** Called when the peer confirms up to comfirmed. */ virtual void senderConfirmed(const SessionPoint& confirmed); @@ -128,7 +134,6 @@ class SessionState { */ virtual ReplayRange senderExpected(const SessionPoint& expected); - // ==== Functions for receiver state /** Set the command point. */ @@ -161,7 +166,7 @@ class SessionState { private: struct SendState { - SendState() : unflushedSize(), replaySize() {} + SendState(); // invariant: replayPoint <= flushPoint <= sendPoint SessionPoint replayPoint; // Can replay from this point SessionPoint flushPoint; // Point of last flush @@ -170,16 +175,15 @@ class SessionState { size_t unflushedSize; // Un-flushed bytes in replay list. size_t replaySize; // Total bytes in replay list. SequenceSet incomplete; // Commands sent and not yet completed. + size_t bytesSinceKnownCompleted; // Bytes sent since we last issued a knownCompleted. } sender; struct ReceiveState { - ReceiveState() {} + ReceiveState(); SessionPoint expected; // Expected from here SessionPoint received; // Received to here. Invariant: expected <= received. SequenceSet unknownCompleted; // Received & completed, may not not known-complete by peer. SequenceSet incomplete; // Incomplete received commands. - int segmentType; - } receiver; SessionId id; |