⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 server.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
字号:
// server.cpp,v 1.17 2000/09/01 05:05:33 coryan Exp

//============================================================================
//
// = FILENAME
//     server.cpp
//
// = DESCRIPTION
//     Server application to test the Servant Activator and Servant Locator.
//
// = AUTHOR
//     Kirthika Parameswaran <kirthika@cs.wustl.edu>
//
//=============================================================================

#include "Server_Manager.h"

ACE_RCSID(On_Demand_Loading, server, "server.cpp,v 1.17 2000/09/01 05:05:33 coryan Exp")

int
main (int argc, char **argv)
{
  Server_i server;

  if (server.init (argc, argv) != 0)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "Failure during Initialisation: init ()\n"),
                      -1);

  // This POA is used to test the Servant Activator interface and
  // hence has an RETAIN policy.
  PortableServer::POA_var first_poa =
    server.create_poa ("firstPOA", 1);

  if (first_poa.in () == 0)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "Failure during first POA creation: create_poa ()\n"),
                      -1);

  // This poa is used to test the Servant Activator interface and
  // hence has an NONRETAIN policy.
  PortableServer::POA_var second_poa =
    server.create_poa ("secondPOA", 0);

  if (second_poa.in () == 0)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "Failure during second POA creation: create_poa ()\n"),
                      -1);

  // The Servant Activator interface is created and initialised.
  if (server.create_activator (first_poa) != 0)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "Failure during first Servant Activator creation: create_activator()\n"),
                      -1);

  // The Servant Locator interface is created and initialised.
  if (server.create_locator (second_poa) !=0)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "Failure during first Servant Locator creation: create_activator()\n"),
                      -1);

  // The server begins processing requests.
  if (server.run () != 0)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "Failure during request processing: run ()\n"),
                      -1);
  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -