|
Boost Users : |
Subject: Re: [Boost-users] [boost-users][asio] timeout - isio_service.reset() safe with pool of threads?
From: tomasz jankowski (tomasz_jacek_at_[hidden])
Date: 2009-02-02 03:26:57
That function assumes the io_service associated with your socket is *stopped*, so it cannot run either in one thread or in multiple threads.
Note that it is an async. implementation for *synchronous* use, and when you use sync. i/o you do not explicitly run io_service:
But if you've already got an async. design, you don't need workarounds to implement timeouts - just use deadline_timer in the straightforward way.io_service io;
tcp::socket sock(io);
// open socket, define your buffer..., then:
read_with_timeout(sock, buffer);
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net