Esempio n. 1
0
int main(int argc, char* argv[])
{
   Logger logger = Logger::getInstance(LOG4CPLUS_TEXT("test.ChannelSupervisor.Server"));
   PropertyConfigurator::doConfigure(LOG4CPLUS_TEXT("log4cplus.properties"));

   int option_index = 0;
   int c;

   while (true)
   {
      c = getopt_long(argc, argv, "x:u:r:p:", long_options, &option_index);

      if (-1 == c)
         break;

      switch (c)
      {
      case 'x':
         //Log("option x = '%s'", optarg);
         strncpy(cs_sock_path.begin(), optarg, cs_sock_path.size());
         cs_sock_path[cs_sock_path.size() - 1] = 0;
         break;
      case 'u':
         //Log("option u = '%s'", optarg);
         strncpy(ca_sock_path.begin(), optarg, ca_sock_path.size());
         ca_sock_path[ca_sock_path.size() - 1] = 0;
         break;
      default:
         //Log("unknown param %c (%d)", c, c);
         exit(1);
         break;
      }
   }

   if (ca_sock_path[0] != 0)
   {
      extern char const * gpCA_UNIX_SOCK_PATH;
      gpCA_UNIX_SOCK_PATH = ca_sock_path.begin();
      // gpCA_UNIX_SOCK_PATH = "/tmp/axis_ca2";
   }

   if (cs_sock_path[0] != 0)
   {
      extern char const * gpNEGOTIATOR_IPC_ADDR;
      gpNEGOTIATOR_IPC_ADDR = cs_sock_path.begin();
      // gpNEGOTIATOR_IPC_ADDR = "/tmp/axis_neg2";
   }


   //


   CServer server;
   server.threadFunc();
   // server.start();
   // while(true)
   // {
   //    sleep(1000);
   // };
}
Esempio n. 2
0
int main(int argc, char* argv[])
{
    PropertyConfigurator::doConfigure(LOG4CPLUS_TEXT("ProfileTestChannelTest.properties"));
    int option_index = 0;
    int c;

    while (true)
    {
        c = getopt_long(argc, argv, "x:u:", long_options, &option_index);

        if (-1 == c)
        {
            break;
        }

        switch (c)
        {
        case 'x':
            strncpy(cs_sock_path.begin(), optarg, cs_sock_path.size());
            cs_sock_path[cs_sock_path.size() - 1] = 0;
            break;
        case 'u':
            strncpy(ca_sock_path.begin(), optarg, ca_sock_path.size());
            ca_sock_path[ca_sock_path.size() - 1] = 0;
            break;
        default:
            exit(1);
            break;
        }
    }

    if (0 != ca_sock_path[0])
    {
        extern char const * gpCA_UNIX_SOCK_PATH;
        gpCA_UNIX_SOCK_PATH = ca_sock_path.begin();
    }

    if (0 != cs_sock_path[0])
    {
        extern char const * gpNEGOTIATOR_IPC_ADDR;
        gpNEGOTIATOR_IPC_ADDR = cs_sock_path.begin();
    }

    // please run client first
    CSignalSemaphoreInterproc::unlink(gSemServerName.c_str());
    CSignalSemaphoreInterproc::unlink(gSemClientName.c_str());

    ChannelClient client;
    client.threadFunc();
}
Esempio n. 3
0
int main(int argc, char* argv[])
{
   Logger logger = Logger::getInstance(LOG4CPLUS_TEXT("ConnectivityAgent.test.client.main"));

   PropertyConfigurator::doConfigure(LOG4CPLUS_TEXT("log4cplus.properties"));

   int option_index = 0;
   int c;

   while (true)
   {
      c = getopt_long(argc, argv, "x:u:r:p:", long_options, &option_index);

      if (-1 == c)
         break;

      switch (c)
      {
      case 'u':
         //Log("option u = '%s'", optarg);
         strncpy(ca_sock_path.begin(), optarg, ca_sock_path.size());
         ca_sock_path[ca_sock_path.size() - 1] = 0;
         break;
      default:
         //Log("unknown param %c (%d)", c, c);
         exit(1);
         break;
      }
   }

   if (ca_sock_path[0] != 0)
   {
      extern char const * gpCA_UNIX_SOCK_PATH;
      gpCA_UNIX_SOCK_PATH = ca_sock_path.begin();
   }

   // please run client first
   CSignalSemaphoreInterproc::unlink("/connectivity_agent_test_server");
   CSignalSemaphoreInterproc::unlink("/connectivity_agent_test_client");

   CClient client;
   client.threadFunc();
   // client.start();
   // while(true)
   // {	

   //    sleep(1000);
   // };
}
Esempio n. 4
0
File: Input.cpp Progetto: 456z/gosu
 Impl(Input& input)
 : input(input), textInput(NULL)
 {
     std::fill(buttonStates.begin(), buttonStates.end(), false);
     
     mouseFactorX = mouseFactorY = 1;
     mouseOffsetX = mouseOffsetY = 0;
 }
Esempio n. 5
0
int profileManagerEntryPoint(const std::string& pathToProfileRepository, const std::string& pathToServiceRepository)
#endif //ANDROID
{
    Logger logger = Logger::getInstance(LOG4CPLUS_TEXT("profileManager.PMP.process.main"));

    WatchdogThread watchdogThread(iviLink::SystemController::PROFILE_MANAGER);
    watchdogThread.start();

    iviLink::conf::Configurator config("");
#ifndef ANDROID
    PropertyConfigurator::doConfigure(LOG4CPLUS_TEXT("log4cplus.properties"));

    int option_index = 0;
    int c;

    while (true)
    {
        c = getopt_long(argc, argv, "x:u:r:p:", long_options, &option_index);

        if (-1 == c)
        {
            break;
        }

        switch (c)
        {
        case 'x':
            strncpy(cs_sock_path.begin(), optarg, cs_sock_path.size());
            cs_sock_path[cs_sock_path.size() - 1] = 0;
            break;
        case 'u':
            strncpy(ca_sock_path.begin(), optarg, ca_sock_path.size());
            ca_sock_path[ca_sock_path.size() - 1] = 0;
            break;
        case 'r':
            strncpy(repo_sock_path.begin(), optarg, repo_sock_path.size());
            repo_sock_path[repo_sock_path.size() - 1] = 0;
            break;
        case 'p':
            strncpy(pmp_sock_path.begin(), optarg, pmp_sock_path.size());
            pmp_sock_path[pmp_sock_path.size() - 1] = 0;
            break;
        default:
            LOG4CPLUS_FATAL(logger, "unknown param");
            exit(1);
            break;
        }
    }

    if (ca_sock_path[0] != 0)
    {
        extern char const * gpCA_UNIX_SOCK_PATH;
        gpCA_UNIX_SOCK_PATH = ca_sock_path.begin();
    }

    if (ca_sock_path[0] != 0)
    {
        extern char const * gpNEGOTIATOR_IPC_ADDR;
        gpNEGOTIATOR_IPC_ADDR = cs_sock_path.begin();
    }


    if (repo_sock_path[0] != 0)
    {
        config.setParam("pmp_repo_ipc_address", repo_sock_path.begin());
    }

    if (pmp_sock_path[0] != 0)
    {
        config.setParam("pmp_ipc_address", pmp_sock_path.begin());
    }
#else
    config.setParam("path_to_database", pathToProfileRepository);
    config.setParam("path_to_services", pathToServiceRepository);
#endif //ANDROID

    iviLink::PMP::PmpComponentManager manager(&config);
    manager.initPmp();
    manager.wait();
    manager.uninitPmp();

    return 0;
}