question

Dale Strickler avatar image
Dale Strickler asked

Best test for availability

We want to queue PlayFab calls and only send them when we have a network. What is the best way to test if we can reach the PlayFab server? Pinging our title URL seems to get an unknown host error? I can call some random client API with poorly formed or random parameters and sort out the error code. What is the recommended way to tell if we can reach the service from the game?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The concept of checking for availability is actually invalid. Just because one call works, does not have any bearing on whether a subsequent call will. You should always have error checking on every call that you make.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dale Strickler avatar image Dale Strickler commented ·

Agreed. At the same time there are times when I would like to do a quick check. Maybe that idea is wrong. I have to think about it more. But, yes, I do check every call for errors. My debug panel has a network presence light I update each screen refresh. I am doing a get player data which seems over kill. I would like a very lightweight test. As well as the error returns.

0 Likes 0 ·
brendan avatar image brendan Dale Strickler commented ·

The problem is that it's false data, and is generating unnecessary calls. I would recommend removing the extra calls, and just base your red/green light on the success of the last API call that was made.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.