A network sender component that can be configured to issue timeout events. More...
#include <timers.hpp>

Public Member Functions | |
| virtual | ~timed_sender () |
| void | set_timeouts (timeout_policy type, size_t ms=0) |
| Set the policy for timed operations (such as send. | |
| template<class Handler > | |
| void | start_timer (timer *timer, shared_buffer buffer, Handler handler) const |
| Start a timer given the current configuration. | |
| bool | timeouts_enabled () const |
| virtual timer * | create_timer ()=0 |
| Creates a timer using the current io_service of this component. | |
Protected Member Functions | |
| timed_sender () | |
| Standard constructor. | |
Protected Attributes | |
| timeout_policy | timeout_type_ |
| Type of timer policy. | |
| size_t | timeout_milliseconds_ |
| Amount of ms relevant to this policy. | |
A network sender component that can be configured to issue timeout events.
Definition at line 229 of file timers.hpp.
| virtual ana::detail::timed_sender::~timed_sender | ( | ) | [inline, virtual] |
Definition at line 233 of file timers.hpp.
| ana::detail::timed_sender::timed_sender | ( | ) | [protected] |
Standard constructor.
Definition at line 123 of file asio_timers.cpp.
| virtual timer* ana::detail::timed_sender::create_timer | ( | ) | [pure virtual] |
Creates a timer using the current io_service of this component.
For efficiency reasons, always create timers this way when you have the chance.
Referenced by asio_sender::send(), asio_client::start_connection_timer(), ana_multiple_receive_handler::wait_completion(), and ana_receive_handler::wait_completion().

| void ana::detail::timed_sender::set_timeouts | ( | timeout_policy | type, | |
| size_t | ms = 0 | |||
| ) |
Set the policy for timed operations (such as send.
)
| type | : Type of timeout policy. | |
| ms | : Milliseconds related to the given policy, 0 means no timeouts. |
Examples:
Definition at line 109 of file asio_timers.cpp.
References timeout_milliseconds_, and timeout_type_.
| void ana::detail::timed_sender::start_timer | ( | timer * | timer, | |
| shared_buffer | buffer, | |||
| Handler | handler | |||
| ) | const [inline] |
Start a timer given the current configuration.
| buffer | : The buffer used in the send operation. | |
| handler | : The handler of the timeout/abort event. |
Definition at line 259 of file timers.hpp.
References timeout_milliseconds_, timeout_type_, timeouts_enabled(), ana::TimePerKilobyte, and ana::timer::wait().
Referenced by asio_sender::send().


| bool ana::detail::timed_sender::timeouts_enabled | ( | ) | const |
Definition at line 118 of file asio_timers.cpp.
References timeout_milliseconds_, and timeout_type_.
Referenced by asio_sender::send(), and start_timer().

size_t ana::detail::timed_sender::timeout_milliseconds_ [protected] |
Amount of ms relevant to this policy.
Definition at line 292 of file timers.hpp.
Referenced by set_timeouts(), start_timer(), and timeouts_enabled().
Type of timer policy.
Definition at line 289 of file timers.hpp.
Referenced by set_timeouts(), start_timer(), and timeouts_enabled().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:19:18 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |