예제 #1
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();
			}
예제 #2
0
void MemoryWatcher::Poll()
{
  if (!m_running) return;
  
  std::string message = ComposeMessages();
  
  zmq::message_t zmq_msg (message.size());
  memcpy (zmq_msg.data (), message.c_str(), message.size());
  m_socket->send (zmq_msg);
  
  //TODO: do something with this request
  zmq::message_t request;
  m_socket->recv (&request);
}