Jump to content
The simFlight Network Forums

FSUIPC problem while flying, lost connection


Recommended Posts

Hi,

I having some problems with FSUIPC and some of my users.

The problem that they have is that when they are Flying with The software I developed, some times or most of the times the Lost conection with FSUIPC. This is one of the example code:

FSUIPC_Read &h56C , 4, VarPtr(Result), (dwResult)
If FSUIPC_Process(dwResult) then
   do this
else
   show error "LOST CONNECTION WITH FSUIPC"
end if

This is so wierd, because this error should appear only when the FS crash, o the user close it. But it happend when they are fliying.

Now I must say that this problem occurs only with 2 people, so it´s not a big problem, but want to fix it any way.

So if some one happend to now something about this problem, o had have the same problem with other program that uses FSUIPC, I will apreciate very much if he could give me a hand.

Best Regards

Thomas.

Link to comment
Share on other sites

The problem that they have is that when they are Flying with The software I developed, some times or most of the times the Lost conection with FSUIPC. This is one of the example code:

FSUIPC_Read &h56C , 4, VarPtr(Result), (dwResult)
If FSUIPC_Process(dwResult) then
   do this
else
   show error "LOST CONNECTION WITH FSUIPC"
end if

Does the FSUIPC_Process routine you are using have a short timeout? Does it have any retries? The C library I supply only gives a TimeOut error after 10 times timeouts of 2 seconds -- a full 20 seconds with no response.

There are also other reasons for an error return from FSUIPC_Process. It looks like your code is assuming a timeout when, in fact, it may be a data error. The C library can return these errors from FSUIPC_Process:

FSUIPC_ERR_NOTOPEN

FSUIPC_ERR_NODATA

FSUIPC_ERR_TIMEOUT

FSUIPC_ERR_SENDMSG

FSUIPC_ERR_DATA

Now whilst it is undoubtedly not one of the first two, you may need to distinguish between the others.

In my programs I simply Sleep() a little and try re-connecting (i.e. on error, FSUIPC_Close, then Open again, and retry). I do this until connection is made again. This takes care of long outages which can sometimes occur when FS is very busy doing file operations in menus and so on.

Regards

Pete

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.