1. If the connection lost, and then reconnected, would the messages or events happened during the period of disconnection received automatically?
2. Would server save/log every event or message so that I can retrieve them after reconnection?
Or maybe I need to retrieve them to analyze by using another server.
If possible, please give me some example code or documents to figure out the suggested implementation.
Thanks a lot!
Best Answer
C
Customer Support
said
almost 7 years ago
Hey Jason,
If a durable request is called from the client but there is no connection to GS, it will be cached until the next time GS finds a connection. So, by default GS will disconnect when the app is suspended (unless you can get the sockets to stay open yourself). When a connection is found it will send off any cached durable request.
Does that clear things up? Let me know if thats okay.
If you're using the Unity SDK you can use a function called SetDurable to achieve what you are asking above, it will queue up all your requests and resend them when the connection is re-established, you can read more about it here. Currently this functionality hasn't been added to the other SDKS but we do hope to add it to them in future updates.
Thanks,
Liam
J
Jo Huang
said
over 7 years ago
hi Liam
Thanks for help.
for #1 question,
Unfortunately we are using cocos2d-x SDK, and we need the function you mentioned.
Any suggestion to implement by ourself?
for #2 question
Can I use RESTful API or something to retrieve every moves by the other server?
Thanks!
Jo
Customer Support
said
over 7 years ago
Hey Jo,
Can you clarify what you mean by "retrieve every moves by the other server"
Thanks,
Liam
J
Jason McIntosh
said
almost 7 years ago
Is durability implemented in a way such that the cached messages will be sent even if the app is closed and restarted? (Docs don't mention that scenario.) This is very common on mobile, when you background an app and the OS decides to free up resources and kills the application.
Cheers,
Jason
Customer Support
said
almost 7 years ago
Answer
Hey Jason,
If a durable request is called from the client but there is no connection to GS, it will be cached until the next time GS finds a connection. So, by default GS will disconnect when the app is suspended (unless you can get the sockets to stay open yourself). When a connection is found it will send off any cached durable request.
Does that clear things up? Let me know if thats okay.
Sean
J
Jason McIntosh
said
over 6 years ago
Thanks, Sean. That sounds great. Sorry for the super slow response!
Customer Support
said
over 6 years ago
Hi Jason,
Glad we could be of help. I'll mark Seans reply as the answer to this post.
Jo Huang
I have the question about connection lost.
1. If the connection lost, and then reconnected, would the messages or events happened during the period of disconnection received automatically?
2. Would server save/log every event or message so that I can retrieve them after reconnection?
Or maybe I need to retrieve them to analyze by using another server.
If possible, please give me some example code or documents to figure out the suggested implementation.
Thanks a lot!
If a durable request is called from the client but there is no connection to GS, it will be cached until the next time GS finds a connection. So, by default GS will disconnect when the app is suspended (unless you can get the sockets to stay open yourself). When a connection is found it will send off any cached durable request.
Does that clear things up?
Let me know if thats okay.
Sean
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hey Jo,
If you're using the Unity SDK you can use a function called SetDurable to achieve what you are asking above, it will queue up all your requests and resend them when the connection is re-established, you can read more about it here. Currently this functionality hasn't been added to the other SDKS but we do hope to add it to them in future updates.
Thanks,
Liam
Jo Huang
hi Liam
Thanks for help.
for #1 question,
Unfortunately we are using cocos2d-x SDK, and we need the function you mentioned.
Any suggestion to implement by ourself?
for #2 question
Can I use RESTful API or something to retrieve every moves by the other server?
Thanks!
Jo
Customer Support
Hey Jo,
Can you clarify what you mean by "retrieve every moves by the other server"
Thanks,
Liam
Jason McIntosh
Is durability implemented in a way such that the cached messages will be sent even if the app is closed and restarted? (Docs don't mention that scenario.) This is very common on mobile, when you background an app and the OS decides to free up resources and kills the application.
Cheers,
Jason
Customer Support
If a durable request is called from the client but there is no connection to GS, it will be cached until the next time GS finds a connection. So, by default GS will disconnect when the app is suspended (unless you can get the sockets to stay open yourself). When a connection is found it will send off any cached durable request.
Does that clear things up?
Let me know if thats okay.
Sean
Jason McIntosh
Thanks, Sean. That sounds great. Sorry for the super slow response!
Customer Support
Hi Jason,
Glad we could be of help. I'll mark Seans reply as the answer to this post.
Best Regards, Patrick.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics