void IghtConnectionState::handle_write(bufferevent *bev, void *opaque) { auto self = (IghtConnectionState *) opaque; (void) bev; // Suppress warning about unused variable self->on_flush(); }
void EmitterBase::close(Callback<> cb) { if (close_pending) { /* * Rationale for throwing rather than ignoring: (1) it was the * behavior before we started refactoring; (2) the user expects * a callback to be called after close is successful. If we do * ignore subsequent close attempts, the promise that the callback * will be called is silently broken, and it seems instead better * to inform the caller that there is a problem with the code * because `close()` has been called more than once. */ throw std::runtime_error("close already pending"); } close_pending = true; shutdown(); on_connect(nullptr); on_data(nullptr); on_flush(nullptr); on_error(nullptr); close_cb = cb; }
void output_impl::flush() { m_incoming_ptr = 0; m_incoming.set_size(0); on_flush(); }