Keep alive UDP socket in background for ios

耗尽温柔 提交于 2019-12-11 02:56:46

问题


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.

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.

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

来源:https://stackoverflow.com/questions/24280061/keep-alive-udp-socket-in-background-for-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!