I'm doing a VOIP project on iPhone. I have the problem to keep the socket alive.
I already configured one socket for VOIP usage, and set kCFStreamNetworkServiceTypeVoIP
for CFReadStreamRef
and CFWriteStreamRef
.
- When my app runs in the foreground and I don't do any action, after 1 minute iPhone will sleep, black screen. My socket is still connected to the server.
- But when my app runs in the foreground I press home button, and don't do any action, about 1 minute iPhone will sleep, then my socket disconnects from server.
Please help me.