Exemplo n.º 1
0
int main(int argc, char** argv)
{
    QApplication app(argc, argv);
    ChatServer myserver(2323);
    myserver.show();
    return app.exec();
}
Exemplo n.º 2
0
int main(int argc, char* argv[])
{
  try
  {

    struct t_hostparams params;
    getoptions(argc, argv, params);

	// Check command line arguments.
    if (params.notconfigured())
    {
      std::cerr << " To run final usage:  -h <address> -p <port> -d <doc_root>\n";
      std::cerr << " try:\n";
      std::cerr << " ./final -h 0.0.0.0 -p 80 -d .\n";
      return 1;
    }

   auto pid = fork();
   if (!pid)
   {
    httpservice::server myserver(params.host, params.port, params.doc_root);
    myserver.run();
   }
  else
  {
    std::ofstream f("final.pid");
    f << pid << std::endl;
  }

  }
  catch (std::exception& e)
  {
    std::cerr << "std::exception: " << e.what() << "\n";
  }

  return 0;
}
Exemplo n.º 3
0
Arquivo: server.c Projeto: tianqiu/c
static int server_init(void)
{
    printk("server init:\n");
    myserver();
    return 0;
}