blob: 3d72b7f2e8b830a4eaea8c5b028783d8225fc24f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
#include <Ice/Ice.h>
#include <TestHelper.h>
#include <TestI.h>
using namespace std;
class Server : public Test::TestHelper
{
public:
void run(int, char**);
};
void
Server::run(int argc, char** argv)
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceDiscovery();
#endif
Ice::CommunicatorHolder communicator = initialize(argc, argv);
Ice::PropertiesPtr properties = communicator->getProperties();
int num = argc == 2 ? atoi(argv[1]) : 0;
properties->setProperty("ControlAdapter.Endpoints", getTestEndpoint(num));
{
ostringstream os;
os << "control" << num;
properties->setProperty("ControlAdapter.AdapterId", os.str());
}
properties->setProperty("ControlAdapter.ThreadPool.Size", "1");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ControlAdapter");
{
ostringstream os;
os << "controller" << num;
adapter->add(ICE_MAKE_SHARED(ControllerI), Ice::stringToIdentity(os.str()));
}
adapter->activate();
serverReady();
communicator->waitForShutdown();
}
DEFINE_TEST(Server)
|