diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-10-20 13:24:19 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-10-20 13:24:19 +0000 |
commit | 280c0231d0a4630a3327dca70d467613e6e97aea (patch) | |
tree | e408728be00bcac1b06a6582e437602f8526c5af /cpp/src/IceGrid/IceGridNode.cpp | |
parent | - Update required version of Mono to 1.1.8 in INSTALL.MONO file (diff) | |
download | ice-280c0231d0a4630a3327dca70d467613e6e97aea.tar.bz2 ice-280c0231d0a4630a3327dca70d467613e6e97aea.tar.xz ice-280c0231d0a4630a3327dca70d467613e6e97aea.zip |
Observer bug fixes.
Diffstat (limited to 'cpp/src/IceGrid/IceGridNode.cpp')
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index fe694d478bc..72f16891863 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -59,8 +59,11 @@ public: Lock sync(*this); while(!_shutdown) { - _node->keepAlive(); - + int timeout = _node->keepAlive(); + if(timeout > 0) + { + _timeout = IceUtil::Time::seconds(timeout); + } if(!_shutdown) { timedWait(_timeout); @@ -79,7 +82,7 @@ public: private: const NodeIPtr _node; - const IceUtil::Time _timeout; + IceUtil::Time _timeout; bool _shutdown; }; typedef IceUtil::Handle<KeepAliveThread> KeepAliveThreadPtr; @@ -444,10 +447,11 @@ NodeService::start(int argc, char* argv[]) adapter->add(_node, nodeProxy->ice_getIdentity()); // - // Register this node with the node registry. + // Start the keep alive thread. By default we start the thread + // with a 5s timeout, then we'll use the registry node session + // timeout / 2. // - int timeout = properties->getPropertyAsIntWithDefault("IceGrid.Node.KeepAliveTimeout", 5); // 5 seconds - _keepAliveThread = new KeepAliveThread(_node, timeout); + _keepAliveThread = new KeepAliveThread(_node, 5); _keepAliveThread->start(); // |