qsieve

qsieve Mercurial Source Tree


Root/src/XML_StatusServer.cc

/*! @file
 * @brief
 * implementation of a server providing XML status reports via TCP
 */
 
 
/// XML status report server class
class CXML_StatusServer
{
 public:
  static void install_XML_StatusServer();
  static void* THREAD_XML_StatusServer(void*);
};
 
 
void* CXML_StatusServer::THREAD_XML_StatusServer(void*)
{
  ExitManager::register_cancel();
  //cout << "Hello, I'm the XML Status Server, thread id = " << pthread_self() << endl;
  const connection_waiter my_connection_waiter(XML_status_port);
  while (true)
   {
     unix_io_stream tcp(my_connection_waiter.get_new_client_socket_descriptor()); // wait for client call
     statistical_data::XML_StatusReport(tcp);
   }
}
 
 
void CXML_StatusServer::install_XML_StatusServer()
{
  static pthread_attr_t detached_thread;
  static pthread_t thread_process_XML;
 
  pthread_attr_init(&detached_thread);
  pthread_attr_setdetachstate(&detached_thread, PTHREAD_CREATE_DETACHED);
   
  cout << "installing XML status server..." << endl;
 
  const int retcode = pthread_create(&thread_process_XML,
    &detached_thread,CXML_StatusServer::THREAD_XML_StatusServer, NULL);
 
  if (retcode != 0)
   {
     cerr << "pthread_create failed!" << endl;
     exit(1);
   }
 
  cout << "XML status server installed." << endl;
}
Source at commit d3bce9735b5d created 11 years 9 months ago.
By Nathan Adams, Fixing asm code

Archive Download this file

Branches

Tags

Page rendered in 0.74216s using 11 queries.