Jump to content
Sign in to follow this  
Guest rbumm

SimConnect server closes

Recommended Posts

Guest rbumm

Hi, From a standalone client application (EXE), hSimConnect = Simconnect_open(...) is used to open a connection to the SimConnect server and receiving a valid handle. SimConnect_Close(hSimConnect) will close this session. Is there a possibility to detect that the SimConnect Server itself is closing (i.e. FSX is about to shut down) or no longer available ? Can you subscribe to a system event that will give you this information ? The standalone application would have to try reconnecting to the FSX server unless FSX is again started and the server is again available ... Any ideas ? rudolf

Share this post


Link to post
Share on other sites

>Is there a possibility to detect that the SimConnect Server>itself is closing (i.e. FSX is about to shut down) or no>longer available ? Can you subscribe to a system event that>will give you this information ? There doesn't appear to be anything we can use. From my DLL (FSUIPC4) which is of course also a SimConnect Client I do get a call to an exported routine called "DLLstop", after which I can tidy my own resources, but by the time this is called it is mostly too late to do anything with FS, even via SimConnect.I have put in a request for some early warning event to be provided which still leaves scope for calls back to SimConnect.Regards,Pete Dowson


Win10: 22H2 19045.2728
CPU: 9900KS at 5.5GHz
Memory: 32Gb at 3800 MHz.
GPU:  RTX 24Gb Titan
2 x 2160p projectors at 25Hz onto 200 FOV curved screen

Share this post


Link to post
Share on other sites
Guest qurious

Yes, there is actually ... when you get SIMCONNECT_RECV_ID_QUIT in the DispatchProc (or the OnRecvQuit event in C#) you know that FSX was exited.

Share this post


Link to post
Share on other sites

I was going to say, my online flight tracker (shameless plug) uses that and pops up a little message. It's been about a week and a half since I looked at the code, since I'm building the web interface for it, so I couldn't remember if that was the case.

Share this post


Link to post
Share on other sites
Guest rbumm

Thanks gurious, this sounds as it is exactly what I am looking for ...regardsrudolf

Share this post


Link to post
Share on other sites

>Yes, there is actually ... when you get>SIMCONNECT_RECV_ID_QUIT in the DispatchProc (or the OnRecvQuit>event in C#) you know that FSX was exited.Ah ... I'd seen that and forgotten all about it! It's because it is one you don't need to subscribe to!Thanks ... that may just come in handy for something I've been wanting to try!RegardsPete


Win10: 22H2 19045.2728
CPU: 9900KS at 5.5GHz
Memory: 32Gb at 3800 MHz.
GPU:  RTX 24Gb Titan
2 x 2160p projectors at 25Hz onto 200 FOV curved screen

Share this post


Link to post
Share on other sites

>Thanks ... that may just come in handy for something I've been>wanting to try!Well, after trying it I remembered why I didn't consider the QUIT event in my earlier reply here. It doesn't work, at least for a DLL! Maybe it is only applicable to external programs and is effectively the same as the DLL having its exported DLLstop routine called -- which is too late for my needs.I'll let my request for a proper, early warning, notification stand. ;-)Regards,Pete


Win10: 22H2 19045.2728
CPU: 9900KS at 5.5GHz
Memory: 32Gb at 3800 MHz.
GPU:  RTX 24Gb Titan
2 x 2160p projectors at 25Hz onto 200 FOV curved screen

Share this post


Link to post
Share on other sites
Guest rbumm

Pete, the previously mentioned event works well for me in a standalone client application. In fact, it is included in all the samples of SimConnect, just did not really see it before. When the event is received, I close the SimConnect connection and set hSimConnect = NULL. After that, I check in a timer procedure with 10 Hz whether SimConnect can be opened again (i.e. FSX is restarted, and my client has to go to work). I found it also helpful to subscribe to the 6Hz Simconnect event and the SimStop/Start events for doing all my client work - this seems to prevent SimConnect to flood with messages when FSX becomes slow or is loading ...regardsrb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...