a skeleton of ice server (c++)

Ice::CommunicatorPtr ic;

Ice::InitializationData initData;
Ice::PropertiesPtr props = Ice::createProperties();
props->setProperty("Ice.ThreadPool.Server.Size", "1");
props->setProperty("Ice.ThreadPool.Server.SizeMax", "8");
props->setProperty("Ice.ThreadPool.Server.SizeWarn", "0");
props->setProperty("Ice.ThreadPool.Client.Size", "1");
props->setProperty("Ice.ThreadPool.Client.SizeMax", "8");
props->setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
props->setProperty("Ice.ACM.Server", "30");
initData.properties = props;
ic = Ice::initialize(initData);

 

Ice::ObjectAdapterPtr adapter = ic->createObjectAdapterWithEndpoints(name, part);

adapter->add(api, ic->stringToIdentity("KyotoTyrant"));
adapter->activate();
ic->waitForShutdown();

 

 

in fact. Ice::Application is what you need if only one communicator is used.

你可能感兴趣的:(server)