I am just a novice starting to learn network programming. I was taught that if network change, the socket will be closed. Partial download will drop because IP changes. But I really wonder, smartphones keep moving from place to place, from a network to another or even 4/5G. Smartphones seem to switch network seamlessly without connection loss. Isn't socket closed and connection lost? Doesn't it require new 3whs for the new TCP connection?
P.S. My guess is that nowadays network is fast we won't notice the new 3whs and connect(). It continues connection like wget -c with new IP, but it is very fast. I don't know if my guess is right. Thank you.
CodePudding user response:
Firstly Well configured web servers(google) allow resume downloads so for such servers your act of switching network is supported it also depends on the client used(the app used to download must support this activity).
Secondly There is a standard that is designed to allow such a seamless handover between e.g. Wifi and cell phone, it is called "Mobile IP". Effectively it works a bit like a VPN. No matter what internet connection you use your public IP remains the same and changing between Wifi and cell phone network is covered by the Mobile IP system. Now we also have concepts of aggressive WiFi/Cell Handover in which cellular data takes over in cases where WiFi signal is low or nonexistent.