Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualKnolanCross

Posted 19 November 2012 - 11:04 AM

Don't really know how the .net API works so I can't really tell if there is a better way to do so.

The points I would check are:
- Assuming .IsDataAvailable blocks the thread, will it return true if a connection drops?
- What happens is if the clients don't ask for updates when its idle (I am not assuming this happens, but with your explanation I couldn't be 100% sure) or if no client is connected. Wouldn't your simulation stop then?

Whenever you have a blocking single threaded approach is mostly good to have a timeout in the blocking part to check if everything is ok and avoid the program to stay locked forever. Other than that everything looks fine.

If it is a non-blocking API, I would recomend you to move to a blocking one, since a non-blocking approach is away more expensive.

#1KnolanCross

Posted 19 November 2012 - 11:03 AM

Don't really know how the .net API works so I can't really tell if there is a better way to do so.

The points I would check are:
- Assuming .IsDataAvailable blocks the thread, will it return true if a connection drops?
- What happens is if the clients don't ask for updates when its idle (I am not assuming this happens, but with your explanation I couldn't be 100% sure) or if no client is connected. Wouldn't your simulation stop then?

Whenever you have a blocking single threaded approach is mostly good to have a timeout in the blocking part to check if everything is ok and avoid the program to stay locked forever. Other than that everything looks fine.

PARTNERS