When the screen is off, Android devices usually turn off the CPU and go to a deep hibernation state unless some application is holding a wakelock. The system only wakes up from that state upon device interrupts (e.g. incoming data from the network) or when a scheduled alarm fires. This seems to be very different from a CPU sleep state, where periodic timer interrupts regularly wake up the CPU.
Does this mean that all network events/timers are also suspended (e.g. TCP retransmissions and keepalives), or are they registered as alarms by the Kernel?
I'm wondering if this could interfere with the operation of socket-level keepalives (via the SO_KEEPALIVE socket option). Will this option still work on an Android device, or does this have to be handled by the application on a higher layer?