Connectivity lost after sleep with cellular networks

Hi, I'm using network extension on my VPN app. I'm override the sleep method and send some data to my server when the method call. I noticed that the server requests are succeeded when I'm connecting with a WiFi networks and failed when I'm connecting with cellular networks. Does the OS blocks immediately the connectivity when I'm on the cellular networks and the device enter to sleep?

Answered by DTS Engineer in 794544022
I'm override the sleep method and send some data to my server when the method call.

Is this ‘goodbye’ message something that the server ACKs? Or do you just send it and hope?

The pattern that I’d expect to work is:

  1. The system calls -sleepWithCompletionHandler:.

  2. You send the goodbye request to the server.

  3. You receive the ACK to that.

  4. You then call the completion handler passed to you in step 1.

OTOH, consider this:

  1. The system calls -sleepWithCompletionHandler:.

  2. You send the goodbye message to the server.

  3. You immediately call the completion handler.

Here there’s a race between the goodbye message going out on the ‘wire’ and iOS turning off the application processor.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I'm override the sleep method and send some data to my server when the method call.

Is this ‘goodbye’ message something that the server ACKs? Or do you just send it and hope?

The pattern that I’d expect to work is:

  1. The system calls -sleepWithCompletionHandler:.

  2. You send the goodbye request to the server.

  3. You receive the ACK to that.

  4. You then call the completion handler passed to you in step 1.

OTOH, consider this:

  1. The system calls -sleepWithCompletionHandler:.

  2. You send the goodbye message to the server.

  3. You immediately call the completion handler.

Here there’s a race between the goodbye message going out on the ‘wire’ and iOS turning off the application processor.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Connectivity lost after sleep with cellular networks
 
 
Q