using namespace std;
+//LightBulbTest_Stub::LightBulbTest_Stub(int _portSend, int _portRecv, const char* _skeletonAddress, int _rev, bool* _bResult) {
LightBulbTest_Stub::LightBulbTest_Stub(int _portSend, int _portRecv, const char* _skeletonAddress, int _rev, bool* _bResult) {
+
+ int i=0;
+ string file = "LightBulbTest_cpp" + to_string(i) + ".log";
+ while (ifstream(file.c_str())) {
+ i++;
+ file = "LightBulbTest_cpp" + to_string(i) + ".log";
+ }
+ log.open(file);
+ log << "Constructing LightBulbTest_Stub!" << endl;
+ log << "Port send: " << _portSend << endl;
+ log << "Port recv: " << _portRecv << endl;
+ log << "Skeleton addr: " << _skeletonAddress << endl;
+ log << "Rev: " << _rev << endl;
+ log << "Result: " << _bResult << endl;
+
rmiComm = new IoTRMICommClient(_portSend, _portRecv, _skeletonAddress, _rev, _bResult);
+ log << "Reached 1!" << endl;
rmiComm->registerStub(objectId, 6, &retValueReceived6);
rmiComm->registerStub(objectId, 3, &retValueReceived3);
rmiComm->registerStub(objectId, 8, &retValueReceived8);