我在iOS中創建了套接字連接機制。它工作得很好。但時不時(大約1%)它崩潰了。這裏是崩潰日誌,你知道它爲什麼會發生。iOS Socket連接崩潰
Thread 0 Crashed:
0 libobjc.A.dylib 0x3b01b5b0 _objc_msgSend + 16
1 CoreFoundation 0x332957cf _signalEventSync + 75
2 CoreFoundation 0x3329b623 _cfstream_solo_signalEventSync + 75
3 CoreFoundation 0x33295507 _CFStreamSignalEvent + 327
4 CFNetwork 0x32ffa6ff CoreWriteStreamCFStreamSupport::coreStreamWriteEvent(__CoreWriteStream*, unsigned long) + 99
5 CFNetwork 0x32ffa0b5 CoreWriteStreamClient::coreStreamEventsAvailable(unsigned long) + 37
6 CFNetwork 0x32ffb365 CoreStreamBase::_callClientNow() + 45
7 CFNetwork 0x32ffb0f9 CoreStreamBase::_streamSetEventAndScheduleDelivery(unsigned long, unsigned char) + 89
8 CFNetwork 0x32ffb4ff CoreStreamBase::_streamInterface_SignalEvent(unsigned long, CFStreamError const*) + 35
9 CFNetwork 0x32f69b57 SocketStream::socketCallback(__CFSocket*, unsigned long, __CFData const*, void const*) + 135
10 CFNetwork 0x32f69ab3 SocketStream::_SocketCallBack_stream(__CFSocket*, unsigned long, __CFData const*, void const*, void*) + 75
11 CoreFoundation 0x332cfd81 __CFSocketPerformV0 + 385
12 CoreFoundation 0x332cd683 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
13 CoreFoundation 0x332ccf7f __CFRunLoopDoSources0 + 363
14 CoreFoundation 0x332cbcb7 __CFRunLoopRun + 647
15 CoreFoundation 0x3323eebd _CFRunLoopRunSpecific + 357
16 CoreFoundation 0x3323ed49 _CFRunLoopRunInMode + 105
17 GraphicsServices 0x36e172eb _GSEventRunModal + 75
18 UIKit 0x35154301 _UIApplicationMain + 1121
19 Okey101Plus 0x000e19ab main (main.m:16)
我遇到了完全相同的堆棧。我關閉套接字時(也在dealloc中)將分配委託設置爲零,任何線索?你是如何擺脫這個的? –