diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-09-11 13:46:08 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-09-11 14:02:39 (GMT) |
commit | 1b47266d6b955fb533b4c272b4bcc58693078a1a (patch) | |
tree | dd52b86408a03308c84c33674989d2d75af58893 /Swiften/Network/Timer.h | |
parent | 5e235d01612b2544fe02cc34816cd6e925ed564f (diff) | |
download | swift-contrib-1b47266d6b955fb533b4c272b4bcc58693078a1a.zip swift-contrib-1b47266d6b955fb533b4c272b4bcc58693078a1a.tar.bz2 |
Disable WhitespacePingLayer on disconnect + Timer refactoring.
Timer now no longer runs in its own thread, but in the main Boost
IOService thread.
Diffstat (limited to 'Swiften/Network/Timer.h')
-rw-r--r-- | Swiften/Network/Timer.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Swiften/Network/Timer.h b/Swiften/Network/Timer.h index de97c13..6474fe9 100644 --- a/Swiften/Network/Timer.h +++ b/Swiften/Network/Timer.h @@ -10,22 +10,20 @@ namespace Swift { class Timer : public EventOwner, public boost::enable_shared_from_this<Timer> { public: - Timer(int milliseconds); + Timer(int milliseconds, boost::asio::io_service* service); ~Timer(); void start(); + void stop(); public: boost::signal<void ()> onTick; private: - void doStart(); - void handleTimerTick(); + void handleTimerTick(const boost::system::error_code& error); private: - int timeout_; - boost::asio::io_service* ioService_; - boost::thread* thread_; - boost::asio::deadline_timer* timer_; + int timeout; + boost::asio::deadline_timer timer; }; } |