1 | // XmlIOServer |
---|
2 | #include "xmlioserver.hpp" |
---|
3 | |
---|
4 | #include "attribute_template_impl.hpp" |
---|
5 | #include "group_template_impl.hpp" |
---|
6 | |
---|
7 | #include "client.hpp" |
---|
8 | #include "server.hpp" |
---|
9 | |
---|
10 | #include "fake.hpp" |
---|
11 | |
---|
12 | // Point d'entrée du programme principal |
---|
13 | int main(int argc, char ** argv, char ** UNUSED(env)) |
---|
14 | { |
---|
15 | try |
---|
16 | { |
---|
17 | ARRAY_CREATE(value0, double, 1, [200]); |
---|
18 | ARRAY_CREATE(value1, double, 1, [1000]); |
---|
19 | ARRAY_CREATE(value2, double, 1, [2000]); |
---|
20 | comm::CMPIManager::Initialise(&argc, &argv); // < seulement en mode connecté |
---|
21 | |
---|
22 | if (comm::CMPIManager::IsMaster(comm::CMPIManager::GetCommWorld())) |
---|
23 | { |
---|
24 | comm::CServer server(comm::CMPIManager::GetCommWorld()); |
---|
25 | server.run(); |
---|
26 | std::cout << "fin serveur" << std::endl; |
---|
27 | comm::CMPIManager::Barrier(); |
---|
28 | |
---|
29 | } |
---|
30 | else |
---|
31 | { |
---|
32 | |
---|
33 | comm::CClient client(comm::CMPIManager::GetCommWorld()); |
---|
34 | client.initialize(); |
---|
35 | client.setContext("lol"); |
---|
36 | |
---|
37 | for (int j = 0; j < 10000; j++) |
---|
38 | { |
---|
39 | client.updateCalendar(j); |
---|
40 | client.sendData("mon_champ0", value0); |
---|
41 | client.sendData("mon_champ1", value1); |
---|
42 | client.sendData("mon_champ2", value2); |
---|
43 | } |
---|
44 | client.finalize(); |
---|
45 | comm::CMPIManager::Barrier(); |
---|
46 | } |
---|
47 | |
---|
48 | comm::CMPIManager::Finalize(); // < seulement en mode connecté |
---|
49 | |
---|
50 | |
---|
51 | /*CXIOSManager::Initialise(CXIOSManager::CLIENT_SERVER, &argc, &argv); |
---|
52 | |
---|
53 | CXIOSManager::AddClient("nemo" , 4, 2, &nemo_fake_entry); |
---|
54 | //CXIOSManager::AddClient("orchidee", 1, 1, &orchidee_fake_entry); |
---|
55 | //CXIOSManager::AddClient("lmdz" , 4, 2, &lmdz_fake_entry); |
---|
56 | CXIOSManager::RunClientServer(comm::CMPIManager::GetCommWorld()); |
---|
57 | CXIOSManager::Finalize();*/ |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | } |
---|
62 | catch (CException & exc) |
---|
63 | { |
---|
64 | std::cerr << exc.getMessage() << std::endl; |
---|
65 | CMPIManager::Finalize(); |
---|
66 | return (EXIT_FAILURE); |
---|
67 | } |
---|
68 | return (EXIT_SUCCESS); |
---|
69 | } |
---|
70 | |
---|