Page 1 of 1

Unity3d ConnectionProblem

Posted: 04 Jan 2017, 14:33
by ekrem5353
Hi ,

In my mobile application When I am connecting to smartfox I use the same code with the spacewar example. Which is available on your site. I have been getting complaints that they can not connect to smartfox. If I am not connected with wifi and usually when phone is old I get same error too. After the sfs.Connect(cfg) line onConnection event doesnt come. I go to applications setting and clean app data then it connects again. Is it possible that something stucks in SmartFox object in the static variable or something. it usually connects under 3 seconds but sometimes doesnt. I have samsung note5 I try 100 times it connects every time I try with samsung J5 if I try over and over about third time I get same problem(not wi-fi). I connect and quit application repeat this couple of times then it stucks. after sfs.Connect(cfg) line called. When it stuck it doesnt connect to my game I try connecting different games it connects without problem. is there a configuration on smartfox. It calles sfs.Connect(cfg) onConnect event doesnt happen but if I wait abount couple of minutes later it connects. it timesout and reconnects . and reconnect is like instant.

it is android app on google play

Thanks....

Re: Unity3d ConnectionProblem

Posted: 04 Jan 2017, 16:24
by Lapo
I have no idea.
If the "clean app data" solves the problem I think it's due to some other issues, maybe related to the OS.

Cleaning the app data gets rid of preferences and other locally stored data. The client SmartFox API don't not depend on any locally stored data or cache. I think this might be a good question for the Unity team.

Have you tried searching on their forums?

Re: Unity3d ConnectionProblem

Posted: 31 Jan 2017, 09:46
by ekrem5353
Well I have solved it if anyone has the same problem ( After disconnecting not being able to reconnect to smartfox) I can help.

Re: Unity3d ConnectionProblem

Posted: 31 Jan 2017, 09:55
by Lapo
What caused it?

Re: Unity3d ConnectionProblem

Posted: 01 Feb 2017, 07:16
by ekrem5353
I am not really sure but if we call logout before disconnect we dont have reconnection problem anymore. If we dont, not only it doesnt reconnect but also post requests to php files gets timeout too. Something weird happens with sfs.Disconnect() method. It caused me lots of 1 star on google play.

Re: Unity3d ConnectionProblem

Posted: 01 Feb 2017, 09:16
by Lapo
Maybe this is something specific to the Android runtime, but the part about php files suggests other issues, unrelated to SFS.