Home按键然后锁屏,socket断开连接问题处理(error code=57)

add this to one of your xmppStream delegate's: 

- (void)xmppStream:(XMPPStream *)sender socketWillConnect:(AsyncSocket *)socket 

    // XMPPStream is preparing to connect. 
    // Add the voip flag to the socket. 

    CFReadStreamSetProperty([socket getCFReadStream], kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP); 
    CFWriteStreamSetProperty([socket getCFWriteStream], kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP); 

 

 

你可能感兴趣的:(Home按键然后锁屏,socket断开连接问题处理(error code=57))