f8fa2364504279ca71125df83294581c5758381d
[iot2.git] / iotjava / iotrmi / C++ / basics / TestClassCallbacks_Stub.cpp
1 #include <iostream>
2 #include <string>
3 #include "TestClassComplete_Stub.hpp"
4 #include "CallBack.hpp"
5
6 using namespace std;
7
8 int main(int argc, char *argv[])
9 {
10
11         int port = 5010;
12         const char* address = "localhost";
13         //const char* address = "192.168.2.191";        // RPi2
14         //const char* skeletonAddress = "128.195.136.170";      // dc-9.calit2.uci.edu
15         const char* skeletonAddress = "128.195.204.132";
16         const char* callbackAddress = "128.195.204.132";        // dw-2.eecs.uci.edu (this machine)
17         //const char* skeletonAddress = "192.168.2.108";        // RPi1
18         //const char* callbackAddress = "192.168.2.191";        // RPi2
19         int rev = 0;
20         bool bResult = false;
21         vector<int> ports;
22         ports.push_back(12345);
23         ports.push_back(22346);
24         ports.push_back(32344);
25         ports.push_back(43212);
26
27         TestClassComplete *tcStub = new TestClassComplete_Stub(port, skeletonAddress, callbackAddress, rev, &bResult, ports);
28         cout << "==== CALLBACK ====" << endl;
29         CallBackInterface *cbSingle = new CallBack(2354);
30         tcStub->registerCallback(cbSingle);
31         cout << "Return value from callback: " << tcStub->callBack() << endl;
32
33         return 0;
34 }