From f739d191af76b1b22416f914212153db40abc17d Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 8 Dec 2008 02:18:03 +0000 Subject: OutputControl and subclasses: added giveReadCredit() for IO level flow control. Cluster: Set read credit limit for cluster connections. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@724233 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/AsynchIOHandler.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/sys/AsynchIOHandler.h') diff --git a/cpp/src/qpid/sys/AsynchIOHandler.h b/cpp/src/qpid/sys/AsynchIOHandler.h index c281c27d14..fa020fbce4 100644 --- a/cpp/src/qpid/sys/AsynchIOHandler.h +++ b/cpp/src/qpid/sys/AsynchIOHandler.h @@ -23,6 +23,8 @@ #include "OutputControl.h" #include "ConnectionCodec.h" +#include "AtomicValue.h" +#include "Mutex.h" namespace qpid { @@ -43,6 +45,9 @@ class AsynchIOHandler : public OutputControl { ConnectionCodec* codec; bool readError; bool isClient; + AtomicValue readCredit; + static const int32_t InfiniteCredit = -1; + Mutex creditLock; void write(const framing::ProtocolInitiation&); @@ -56,9 +61,10 @@ class AsynchIOHandler : public OutputControl { // Output side void close(); void activateOutput(); + void giveReadCredit(int32_t credit); // Input side - void readbuff(AsynchIO& aio, AsynchIOBufferBase* buff); + bool readbuff(AsynchIO& aio, AsynchIOBufferBase* buff); void eof(AsynchIO& aio); void disconnect(AsynchIO& aio); -- cgit v1.2.1