Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

dealline_timer_ex.async_wait_timeout() no longer masks error::operati…

…on_aborted when a timer is canceled.
  • Loading branch information...
commit 0c8156538eaa7a1e5a55ed814631d94088dbd1c1 1 parent bee4b14
@saleyn authored
View
7 include/eixx/connect/basic_otp_mailbox.hpp
@@ -190,6 +190,13 @@ class basic_otp_mailbox
throw (std::runtime_error);
/**
+ * Cancel pending asynchronous receive operation
+ */
+ void cancel_async_receive() {
+ m_deadline_timer.cancel();
+ }
+
+ /**
* Get a message from mailbox that matches the given pattern.
* It will block until an apropiate message arrives.
* @param pattern ErlTerm with pattern to check
View
7 include/eixx/marshal/varbind.hpp
@@ -96,9 +96,14 @@ class varbind {
}
const eterm<Alloc>*
+ operator[] (const char* a_var_name) const throw(err_unbound_variable) {
+ return (*this)[string<Alloc>(a_var_name)];
+ }
+
+ const eterm<Alloc>*
operator[] (const string<Alloc>& a_var_name) const throw(err_unbound_variable) {
const eterm<Alloc>* p = find(a_var_name);
- if (!p) throw err_unbound_variable(a_var_name);
+ if (!p) throw err_unbound_variable(a_var_name.c_str());
return p;
}
View
6 include/eixx/util/async_wait_timeout.hpp
@@ -9,7 +9,7 @@ namespace asio {
namespace error {
enum timer_errors {
- timeout
+ timeout = 0
};
namespace detail {
@@ -62,7 +62,7 @@ namespace asio {
void operator() (const system::error_code& ec) {
system::error_code e =
- ec == error::operation_aborted
+ ec == system::error_code()
? system::make_error_code(error::timeout)
: ec;
m_h(e);
@@ -86,6 +86,8 @@ namespace asio {
super::async_wait(wrapper);
}
+ /// Returns <tt>boost::asio::error::operation_aborted</tt> on cancel,
+ /// and <tt>boost::asio::error::timeout</tt> on timeout.
template<typename Handler>
void async_wait_timeout(Handler h, long millisecs)
{
Please sign in to comment.
Something went wrong with that request. Please try again.