Recently,I confused some problems about client(unity) lost connection.
For example,normally I connect to the server with Wi-Fi,but maybe the network is not stable,or maybe the Wi-Fi is lost and then the phone change to use Cellular network automatically, or other reasons,the client lost the connection to the server without any notify.I have added the listener on OnConnectionLost,but the method is not be called.
So,I want to know,when the connection is lost,how can I know?
Some questions about Client lost connection
Re: Some questions about Client lost connection
Hi,
this has been discussed many times. See here:
viewtopic.php?f=18&t=18503&p=80840#p80840
viewtopic.php?f=18&t=19711&p=85173#p85173
Bottom line: switching network doesn't necessarily trigger a disconnection event. You will need to listen for specific events that tell you when the network switch happens. I am not sure if Unity provides them, probably it does but I am not a Unity expert. Sorry. I'd recommend checking their documentation.
If you can detect the network change you can delete disconnect the current SmartFox connection and create a new one.
Hope it helps
this has been discussed many times. See here:
viewtopic.php?f=18&t=18503&p=80840#p80840
viewtopic.php?f=18&t=19711&p=85173#p85173
Bottom line: switching network doesn't necessarily trigger a disconnection event. You will need to listen for specific events that tell you when the network switch happens. I am not sure if Unity provides them, probably it does but I am not a Unity expert. Sorry. I'd recommend checking their documentation.
If you can detect the network change you can delete disconnect the current SmartFox connection and create a new one.
Hope it helps
Who is online
Users browsing this forum: No registered users and 62 guests