在iOS 9.0 中,kCFStreamNetworkServiceTypeVoIP 被弃用
解决方案:
1、导入 #import <PushKit/PushKit.h> 头文件
2、r1 r2 中的 kCFStreamNetworkServiceTypeVoIP 替换为 “PKPushTypeVoIP”
如:
r1 = CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType, PKPushTypeVoIP);
r2 = CFWriteStreamSetProperty(writeStream, kCFStreamNetworkServiceType, PKPushTypeVoIP);
相关链接:https://github.com/robbiehanson/CocoaAsyncSocket/issues/402