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

ppp333ddd_
Posts: 56
Joined: Fri Aug 18, 2017 1:04 am

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

Postby ppp333ddd_ » Thu Apr 19, 2018 1:14 am

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: 1591
Joined: Wed Aug 24, 2011 1:37 pm

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

Postby Rob McCarthy » Thu Apr 19, 2018 12:45 pm

How are you attempting to recover the connection?

Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead

ppp333ddd_
Posts: 56
Joined: Fri Aug 18, 2017 1:04 am

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

Postby ppp333ddd_ » Sat Apr 28, 2018 1:14 am

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


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 4 guests