• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

C SimConnect Client Data Area problems

Messages
516
Hi folks,
I'm having some issue with reliability of client data areas using SimConnect in C.

What I've got are several C structs of custom variables in my aircraft (which has a Simconenct client running in a gauge) that I trying to pass several times a second to an external win32 application, which draws gauges using GDI.

However, I frequently find that SimConnect will suddenly stop sending the data areas to the win32 client. I have to restart the application to get it to continue. Also once the problem starts, it only gets worse with sunsequent restarts (of my app, not FSX) so I wonder if there's some kind of resource leak in FS or problem with a client trying to reconnect to areas previously defined?

Also, I'm setting the frequency parameter in the SimConnect_RequestClientData() function to SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET. And I am adding the wole of the struct to a client area definition with a single SimConnect_AddToClientDataDefinition() call.

(This is done in both the aircraft's generating client and the win32 app's receiving client. But I only call SimConnect_CreateClientData() in the aircraft.)

Is this the right way to go about it? Done this way, should the SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET period mean that the area is passed everytime I execute a SimConnect_SetClientData() on that area? Or is there a subtlety I'm missing?

What happens is that my inline (no callback) SimConnect_RequestClientData() calls in the win32 client stop receiving notifications and the function just returns E_FAIL all the time. I know the SimConnect connection is still "live" as I can send events from my app to the aircraft and see them take effect.

Cheers,

Si
 
Disregard. I think I've found the problem. I have a watchdog thread which monitors callbacks to detect if the connection is lost in which case it tries to reconnect. Only my logic was flawed and it was triggering when it shouldn't and forcing a connection restart erroneously.

Si
 
Back
Top