Sign In Register

How can we help you today?

Start a new topic
Answered

If connection lost.....

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!


Best 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

 


Hi Jason, 

Glad we could be of help. I'll mark Seans reply as the answer to this post. 

Best Regards, Patrick. 

Thanks, Sean. That sounds great. Sorry for the super slow response!

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

 

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

Hey Jo,

Can you clarify what you mean by "retrieve every moves by the other server"


Thanks,

Liam

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

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



Login to post a comment