If I am using a TCP socket in my app and it's connected to a device, what would happen if the user gets a call or the user double presses the home button and swaps apps and then they re-open the app again ?
I am guessing the TCP socket will disconnect since Apple doesn't allow the connections to be open in the background and I would need to re-connect the socket again when the user re-opens the app again ?
That is correct. There are three possible scenarios:
1. The process keeps running and the network connection is kept alive.
2. The process keeps running but the network connection is broken.
3. The process is killed.
Your app should correct handle AsyncStreams events and reconnect when it is active.