Hello,
I attempted to discover if a remote system is lost by calling getLastError() and getErrorCode() to check if error code is 144. However i dont get any response from the worker function when the system goes out.
I have made a dpconnect as follows
dpConnectUserData("stateUpdatedCB",userdata,TRUE,"system1:VCP.state.Availabilty");
and my call back looks as follows
void stateUpdatedCB(string data, string dp, bool val){
dyn_errClass err = getLastError();
int errCode = 0;
if (dynlen(err)>0) {
errCode = getErrorCode(err);
DebugN(err," code ",errCode);
}
if (isRefresh())DebugN(data+" connected or redundancy switch");
}
when the system conencts i get the expected result. nothing happens when the system disconnects. how should i go about fixing this
Thank you
Yasas
Discover system lost in work function for dpconnect with answer distributed system
- yasas@applied.co.uk
- Posts:21
- Joined: Wed Sep 21, 2016 12:26 pm
Discover system lost in work function for dpconnect with answer distributed system
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: Discover system lost in work function for dpconnect with answer distributed system
it depends on what you want to do in your application.
1. If you want your icon to change color when DIST is lost then you should also(!) dpConnect to xxx:_original.._bad
2. When you want your application to show that the dist connection is lost then you should probably connect to the internal datapoints that tell you what dist system you are connect to ( _Connection datapoint type)
So normally in an icon:
1) check that your dpConnect() works. When not -> make your icon purple. Could be :
2) Use getLastError() after your dpConnect() to check for any errors
3) Connect to the xxx:_original.._bad. When the 'bad' becomes true -> make your icon purple
So for the dpConnect() -> check the return code AND check for getLastError() !
This should get you working !
Share the fun
Frenk Mulder
1. If you want your icon to change color when DIST is lost then you should also(!) dpConnect to xxx:_original.._bad
2. When you want your application to show that the dist connection is lost then you should probably connect to the internal datapoints that tell you what dist system you are connect to ( _Connection datapoint type)
So normally in an icon:
1) check that your dpConnect() works. When not -> make your icon purple. Could be :
2) Use getLastError() after your dpConnect() to check for any errors
3) Connect to the xxx:_original.._bad. When the 'bad' becomes true -> make your icon purple
So for the dpConnect() -> check the return code AND check for getLastError() !
This should get you working !
Share the fun
Frenk Mulder