Example #1
0
    void prepare_frame(message::data_ptr msg) {
        assert(msg);
        if (msg->get_prepared()) {
            return;
        }
        
        msg->set_header(std::string(1,0x00));

        struct Marker
        {
            Marker ()
            {
                union
                {
                    char c;
                    unsigned char uc;
                } v;
                
                v.uc = 0xff;

                value = std::string (1, v.c);
            }

            std::string value;
        };
        static Marker marker;
        msg->append_payload(marker.value);
        
        msg->set_prepared(true);
    }
Example #2
0
 void prepare_frame(message::data_ptr msg) {
     assert(msg);
     if (msg->get_prepared()) {
         return;
     }
     
     msg->set_header(std::string(1,0x00));
     
     msg->append_payload(std::string(1,0xFF));
     
     msg->set_prepared(true);
 }