updates interrupt functionality to latest API spec

This commit is contained in:
Peter Thorson
2013-01-06 09:59:38 -06:00
parent 5949c58d2e
commit 05f9faebf5
5 changed files with 30 additions and 24 deletions

View File

@@ -256,19 +256,21 @@ void connection<config>::close(const close::status::value code,
template <typename config>
lib::error_code connection<config>::interrupt() {
std::cout << "connection::interrupt" << std::endl;
/*return transport_type::inturrupt(
return transport_type::interrupt(
lib::bind(
&type::handle_inturrupt,
&type::handle_interrupt,
type::shared_from_this()
)
);*/
);
return lib::error_code();
}
template <typename config>
void connection<config>::handle_interrupt() {
m_handler->on_interrupt(type::shared_from_this());
if (m_interrupt_handler) {
m_interrupt_handler(m_connection_hdl);
}
}

View File

@@ -54,9 +54,14 @@ endpoint<connection,config>::create_connection() {
//
con->set_handle(w);
con->set_handler(m_default_handler);
con->set_handler(m_default_handler);
// Copy default handlers from the endpoint
con->set_open_handler(m_open_handler);
con->set_termination_handler(
con->set_interrupt_handler(m_interrupt_handler);
con->set_termination_handler(
lib::bind(
&type::remove_connection,
this,