Exemplo n.º 1
0
    virtual
    void
    operator()(const msgpack::object& unpacked, const api::stream_ptr_t& upstream) {
        type_traits<R>::pack(m_packer, this->call(unpacked));

        upstream->write(m_buffer.data(), m_buffer.size());
        upstream->close();

        m_buffer.clear();
    }
Exemplo n.º 2
0
    virtual
    std::shared_ptr<dispatch_t>
    operator()(const msgpack::object& unpacked, const api::stream_ptr_t& upstream) {
        type_traits<R>::pack(m_packer, this->call(unpacked));

        upstream->write(m_buffer.data(), m_buffer.size());
        upstream->close();

        m_buffer.clear();

        // Return an empty protocol dispatch.
        return std::shared_ptr<dispatch_t>();
    }