Hi,
your attachment is empty :)
BUT - I got your problem.
Think about how SDK communcation works: (not for all but for some function)
a.) Files with the command (and parameters) are created in ....\SdkFileCalls
b.) TTN periodicly scans this directory - and reads the files (and deletes it)
c.) The answer is generated and also placed in such files
d.) The SDK read the files and gets the result (and deletes the files)
If you make a synchronious call the SDK does:
a, WAIT INFINITE, d
In other words if TTN does not process the file the call freezes your app.
In asynchronius call the things are handled like this:
1.) Call to xxxAsync
a - and return imideately
2.) Call to "ReturnAvail"
- check if the file from point c exists
3.) Call to "....AsyncRetrive
- the work as in d
So now to your code:
1.) Call to async - a file is generated
2.) Wait some fixed time (without a further condition)
3.) Check if a result exists
3a) YES - take the result
3b) NO - does nothing
3b is the problem - if anyhow TTN can not finish the call in the time you give you do not take the respone. Later TTN will process the call and unread answer files will be created - and stay there forever.
So think about:
a.) Why async?
--this is only usefull if you run other threads in your programm
--if you do not use more than one thread - USE SYNCHRONIOUS CALLs
b.) If async is a must - expect getting no answer as a critical error!!!
--Build the loop like this
........
int nCnt=0;
int nRetAvail=0;
do {
Sleep(300); //to small nubers are not a good idea - to large number result in useless waits
nRetAvail=TTN.ReturnAvail....
nCnt++; //try counter
if(nCnt>30) { //I assume about 30 seconds are enough
CRITICAL_ERROR_HANLDER
break; //terminate loop
}
} while(nRetAvail<=0);
if(nRetAvail>0) { //got a result
TTN......AsyncRetrive......
}
By the way - the filesystem in PPC (WM5) is pretty slow. So searching for a file like TTN does it
takes much (!!!) longer in a directory with many files as in one which is empty.
So you orphans (produced by your calls) result in more and more slower response of TTN.
Regards
Manfred