Hi,
I'm using the Fsuipc_MFC in my C++ application.
Everything work fine with Fsuipc communication.
My only problem is i need to read in loop a lots of offset.
These offset are modify in an external program (SIOC for OpenCockpits IoCards).
So i need to verify in a loop if the value of the offset as change.
because the big quantity of reading, i've create a thread only for these action.
The time that i read all the offset, it take a few second to pass all the offset and start again at the top of the list.
i'll try to perform the process() once at every 20 read request. It help a bit but not much.
here the function that i'll create to read the offset:
void SimFsuipc::SimFsuipcRead(DWORD dwOffset, DWORD dwSize, long *pDest)
{
CFSUIPC FSConnection;
static int Count = 0;
FSConnection.Open(Result);
if (FSConnection.GetResultMessage() != 0)
{
cout << FSConnection.GetResultMessageString() << endl;
}
if (!FSConnection.ReadAndProcess(dwOffset, dwSize, pDest))
//if (!FSConnection.Read(dwOffset, dwSize, pDest))
{
FSConnection.GetResultMessage();
cout << FSConnection.GetResultMessageString() << endl;
}
else
{
Count++;
}
/*if (Count >= 20)
{
FSConnection.Process();
Count = 0;
}*/
cout << *pDest << endl;
}
You will find in the attach file my file that is using my function.
Don't forget that these offset are modify in a extern program and that why i need to read them as fast as possible.
What should i do or what method do i need to use to upgrade my reading speed?
Thank you for your help!
Daniel
SimFsuipc_OffsetRead.h