Exemplo n.º 1
0
 void SendResponse( gnuradar::ResponseMessage& msg ){
    std::string serial_msg;
    msg.SerializeToString(&serial_msg);
    zmq::message_t reply (serial_msg.size());
    memcpy ((void *) reply.data (), serial_msg.c_str(), serial_msg.size());
    socket_->send (reply);
 }
Exemplo n.º 2
0
         void Run()
         {
            std::cout << "StatusServer: START " << std::endl;
            active_ = true;
            gnuradar::StatusMessage status_msg;

            while( active_ )
            {
               status_msg.set_name("status");
               status_msg.set_head(pcModel_->Head() );
               status_msg.set_tail(pcModel_->Tail() );
               status_msg.set_depth( pcModel_->Depth());
               status_msg.set_over_flow(pcModel_->OverFlow() );
               status_msg.set_bytes_per_buffer( pcModel_->BytesPerBuffer() );

					std::string data;
					status_msg.SerializeToString(&data);
					zmq::message_t zmq_msg(data.size());
					memcpy ((void *) zmq_msg.data(), data.c_str(), data.size());
					socket_->send (zmq_msg);

					Sleep(thread::MSEC, gnuradar::constants::STATUS_REFRESH_RATE_MSEC);
				}

				std::cout << "StatusServer: STOP " << std::endl;
				socket_->close();
			}