Keep alive UDP socket in background for ios

2.5k views Asked by At

My question is not actually what is the code to keep UDP socket alive when application in background but a confusion about the documentation in apple developer site.

According to apple developer guide if i set kCFStreamNetworkServiceType to kCFStreamNetworkServiceTypeVoIP then this socket will be managed specially by system when app in background.

enter image description here

In CocoaAsyncSocket library they reported that this settings is not working in UDP socket but only in TCP socket. I also tested this option for native CFReadSteam interface but socket didn't alive when app was in background. But apple developer site never mention it. enter image description here

Is this true that only tcp socket can keep alive in background or i am making any mistake in my code?

0

There are 0 answers