// ********************************************************************** // // Copyright (c) 2003-2005 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. // // ********************************************************************** #include SessionPingThread::SessionPingThread(const Glacier2::SessionPrx& session) : _session(session), _timeout(IceUtil::Time::seconds(20)), _destroy(false) { } void SessionPingThread::run() { Lock sync(*this); while(!_destroy) { timedWait(_timeout); if(_destroy) { break; } try { _session->ice_ping(); } catch(const Ice::Exception&) { break; } } } void SessionPingThread::destroy() { Lock sync(*this); _destroy = true; notify(); }