Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What will happen to existing connections when switch between 3g/wifi

Tags:

android

wifi

3g

Assume that, I have a TCP connection that doing heavy data transmitting on my 3G network; and I walked home, Android switch to my home Wifi automatically. Now what happen to the existing connection? is it simply disconnect? or it will keep going, only new connections will use wifi?

In addition, what if I walk away from home, wifi lost signal and switch to 3g? It should be safe to guess the connection is dropped. For my application, do I need to handle the reconnection or there is a auto fall back solution?

Thanks in advance.

Hongbo

like image 736
Hongbo Avatar asked Aug 18 '10 12:08

Hongbo


1 Answers

The connection will drop because your device will appear at a different IP address, which is how TCP packets find their way.

There is no fallback unless you code it up, which you should do anyway if your app spends a lot of time on 3G. It's quite OK for desktop applications to go "D'oh!" when your Cable or DSL has the occasional hiccup, but 3G connections go down routinely.

like image 179
Marcelo Cantos Avatar answered Sep 20 '22 03:09

Marcelo Cantos