Skip to content

Commit

Permalink
Add on_send_empty() to websockettpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahbritto authored and vinniefalco committed May 3, 2013
1 parent 2f33b36 commit 2629859
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,9 @@ class connection
alog()->at(log::alevel::DEBUG_CLOSE)
<< "Exit after inturrupt" << log::endl;
terminate(false);
}
} else {
m_handler->on_send_empty(type::shared_from_this());
}
}
}

Expand Down Expand Up @@ -1267,7 +1269,7 @@ class connection
if (m_write_queue.size() == 0) {
alog()->at(log::alevel::DEBUG_CLOSE)
<< "handle_write called with empty queue" << log::endl;
return;
return;
}

m_write_buffer -= m_write_queue.front()->get_payload().size();
Expand Down
2 changes: 2 additions & 0 deletions src/roles/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ class server {
virtual void on_pong(connection_ptr con,std::string) {}
virtual void on_pong_timeout(connection_ptr con,std::string) {}
virtual void http(connection_ptr con) {}

virtual void on_send_empty(connection_ptr con) {}
};

server(boost::asio::io_service& m)
Expand Down

0 comments on commit 2629859

Please sign in to comment.