在stopSocket方法中crash,CFSocketInvalidate
#0 Thread 0 libsystem_platform.dylib 0x000000022032b0c8 __os_unfair_lock_recursive_abort + 36 1 libsystem_platform.dylib 0x00000002203282d8 __os_unfair_lock_lock_slow + 308 2 CoreFoundation 0x0000000199130924 _CFSocketInvalidate + 136 3 CFNetwork 0x000000019a694aa0 Schedulables::_SchedulablesInvalidateApplierFunction(void const*, void*) + 36 4 CoreFoundation 0x000000019906b2cc _CFArrayApplyFunction + 72 5 CFNetwork 0x000000019a682870 SocketStream::~SocketStream() + 456 6 CoreFoundation 0x000000019901908c __CFRelease + 292 7 CoreFoundation 0x0000000199130c5c _CFSocketInvalidate + 960 8 WDBuyerUniv 0x0000000100e83fa8 -PingFoundation stopSocket 9 WDBuyerUniv 0x0000000100e83fe4 -PingFoundation stop 10 WDBuyerUniv 0x0000000100e84434 -PingHelper clearPingFoundation 11 WDBuyerUniv 0x0000000100e84934 -PingHelper pingTimeOut 12 Foundation 0x0000000197ce98d0 ___NSFireDelayedPerform + 372 13 CoreFoundation 0x00000001990c73f8 _CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 32 14 CoreFoundation 0x00000001990c709c ___CFRunLoopDoTimer + 1012 15 CoreFoundation 0x00000001990c6bf0 ___CFRunLoopDoTimers + 288 16 CoreFoundation 0x00000001990650fc ___CFRunLoopRun + 1856 17 CoreFoundation 0x00000001990645b8 _CFRunLoopRunSpecific + 572 18 GraphicsServices 0x00000001e4afa1c4 _GSEventRunModal + 164 19 UIKitCore 0x000000019bbba5f0 -[UIApplication _run] + 816 20 UIKitCore 0x000000019bc6910c _UIApplicationMain + 340 21 ??? 0x00000001be837d34 0x00000001be837d34 + 0
怎么说,好像目前没有完全解决这类问题的方法。 有没有准备替换Ping的实现?
https://forums.developer.apple.com/forums/thread/724595
https://medium.com/@onlyapps/measure-pings-to-any-host-using-network-framework-ios-swift-3092ef367cd6