diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2008-10-28 13:02:28 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2008-10-28 13:02:28 -0230 |
commit | d439795f3f59182c53e98e8b92fb3171768e03c3 (patch) | |
tree | 169feecdf4e2e61b8c4f0ddda199cd6e191e8adc /cpp/src/Ice/RetryQueue.h | |
parent | Bug 3410 - Check connections for ACM at more appropriate interval (diff) | |
parent | Fixed bug 3513 - AMI retry bug (diff) | |
download | ice-d439795f3f59182c53e98e8b92fb3171768e03c3.tar.bz2 ice-d439795f3f59182c53e98e8b92fb3171768e03c3.tar.xz ice-d439795f3f59182c53e98e8b92fb3171768e03c3.zip |
Merge branch 'R3_3_branch' of ssh://cvs.wpb.zeroc.com/home/git/ice into R3_3_branch
Diffstat (limited to 'cpp/src/Ice/RetryQueue.h')
-rw-r--r-- | cpp/src/Ice/RetryQueue.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/cpp/src/Ice/RetryQueue.h b/cpp/src/Ice/RetryQueue.h new file mode 100644 index 00000000000..960b4a8d220 --- /dev/null +++ b/cpp/src/Ice/RetryQueue.h @@ -0,0 +1,62 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef ICE_RETRY_QUEUE_H +#define ICE_RETRY_QUEUE_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <IceUtil/Timer.h> +#include <Ice/RetryQueueF.h> +#include <Ice/OutgoingAsyncF.h> +#include <Ice/InstanceF.h> + +namespace IceInternal +{ + +class RetryTask : public IceUtil::TimerTask +{ +public: + + RetryTask(const RetryQueuePtr&, const OutgoingAsyncPtr&); + + virtual void runTimerTask(); + void destroy(); + + bool operator<(const RetryTask&) const; + +private: + + const RetryQueuePtr _queue; + const OutgoingAsyncPtr _outAsync; +}; +typedef IceUtil::Handle<RetryTask> RetryTaskPtr; + +class RetryQueue : public IceUtil::Shared, public IceUtil::Mutex +{ +public: + + RetryQueue(const InstancePtr&); + + void add(const OutgoingAsyncPtr&, int); + void destroy(); + +private: + + bool remove(const RetryTaskPtr&); + friend class RetryTask; + + const InstancePtr _instance; + std::set<RetryTaskPtr> _requests; +}; + +} + +#endif + |