how can android keep a TCP connection alive when changing network provider? i'm curious about how android can keep a TCP connection alive while i'm switching from 3G ( mobile data ) to WiFi and viceversa.

i'm asking this after i seen that i had an uninterrupted radio stream thought TuneIn radio.

is that valid only for TuneIn ( via some code workaround ) or it's a cool feature in the Android API calls ?

thanks in advance for any help.

-- my crime is that of curiosity :)
A TCP connection cannot be kept alive during a network change, since you get a new IP address, causing all connections being terminated.

TCP builds upon IP to get the data delivered. If you change networks you also change your public IP address which is used by the TCP connection to let TuneIn deliver data to you.
This invalidates the current connection and forces you to establish a new one.

But there is still a chance of getting an uninterrupted audio stream. The TuneIn app most likely buffers the stream for two or three seconds to compensate for connection hiccups or even a reconnection.