[RESOLVED] simconnect disconnected and can't recover after a few minutes

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

[RESOLVED] simconnect disconnected and can't recover after a few minutes

Post by ppp333ddd_ »

In my C# program, I remotely communicate with P3D (server and client in different PCs), I connect to SimConnect automatically and recover automatically if there are connection problems. For the first few minutes it works fine, but then it can't recover. In the code it is still trying to recover but every time it gets the following error: 'HRESULT E_FAIL has been returned from a call to COM port'. What is wrong? Thanks.
User avatar
Rob McCarthy
Lockheed Martin
Posts: 3703
Joined: Wed Aug 24, 2011 1:37 pm

Re: simconnect disconnected and can't recover after a few minutes

Post by Rob McCarthy »

How are you attempting to recover the connection?

Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

Re: simconnect disconnected and can't recover after a few minutes

Post by ppp333ddd_ »

Hi Rob,

I got this when I use another thread for connection. Then I used the same thread but got a AccessViolationException:"Attempted to read or write protected memory" and I deleted 'simconnect.dispose() & simconnect=null' and it seemed to be fixed.

Kind regards,
Jeff
Locked