diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-09-23 17:50:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-09-23 17:50:31 +0100 |
| commit | e89fb9d81358b51ed0e231725f7fb6eb63f96c5b (patch) | |
| tree | 7388764fb11b97f33c2ab9ffe8cea0679ce20d2e /src/lib/util.h | |
| parent | 6726393a4b186333b8e1080f3f1c5c4b77d4c2e6 (diff) | |
Use io_service per thread.
Diffstat (limited to 'src/lib/util.h')
| -rw-r--r-- | src/lib/util.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/util.h b/src/lib/util.h index 2785a5dc1..8d6e2f541 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -116,9 +116,11 @@ extern std::string colour_lut_index_to_name (int index); class DeadlineWrapper { public: - DeadlineWrapper (boost::asio::io_service& io_service); + DeadlineWrapper (); - void set_socket (boost::shared_ptr<boost::asio::ip::tcp::socket> socket); + boost::asio::ip::tcp::socket& socket () { + return _socket; + } void connect (boost::asio::ip::basic_resolver_entry<boost::asio::ip::tcp> const & endpoint, int timeout); void write (uint8_t const * data, int size, int timeout); @@ -133,9 +135,9 @@ private: DeadlineWrapper (DeadlineWrapper const &); - boost::asio::io_service& _io_service; + boost::asio::io_service _io_service; boost::asio::deadline_timer _deadline; - boost::shared_ptr<boost::asio::ip::tcp::socket> _socket; + boost::asio::ip::tcp::socket _socket; /** a buffer for small reads */ uint8_t _buffer[256]; /** amount of valid data in the buffer */ |
