adds support for message_handler

This commit is contained in:
Peter Thorson
2013-01-08 06:33:02 -06:00
parent 8df37fffbc
commit ef8898afef
5 changed files with 36 additions and 2 deletions

View File

@@ -685,7 +685,10 @@ void connection<config>::handle_read_frame(const lib::error_code& ec,
std::cout << "null message from m_processor" << std::endl;
} else if (!is_control(msg->get_opcode())) {
// data message, dispatch to user
m_handler->on_message(type::shared_from_this(), msg);
//m_handler->on_message(type::shared_from_this(), msg);
if (m_message_handler) {
m_message_handler(m_connection_hdl, msg);
}
} else {
process_control_frame(msg);
}

View File

@@ -67,6 +67,7 @@ endpoint<connection,config>::create_connection() {
con->set_interrupt_handler(m_interrupt_handler);
con->set_http_handler(m_http_handler);
con->set_validate_handler(m_validate_handler);
con->set_message_handler(m_message_handler);
con->set_termination_handler(
lib::bind(