Closed EduardoAlberti closed 9 years ago
I'm having trouble reproducing with your example app
The issue is intermittent, you have to call 'closeWithFast' in the same time when the socket is reconnecting. Also, don't use the 'start' button, instead, you have to restart the app in every try. Remember, the issue is presented on Mavericks only. Hope this helps you.
Hm, if it only happens on mavericks I would say it's a bug in NSURLSession in mavericks
When the socket is trying to reconnect, a call to [socket closeWithFast:NO] makes the app crash.
Example app link: http://d.pr/f/1i2Xf/5ywClxr6
Crash report:
7/3/15 9:48:35.091 AM swiftTest[3295]: SocketClient: Adding handler for event: connect 7/3/15 9:48:35.092 AM swiftTest[3295]: SocketClient: Adding handler for event: currentAmount 7/3/15 9:48:35.092 AM swiftTest[3295]: SocketClient: Adding handler for event: error 7/3/15 9:48:35.092 AM swiftTest[3295]: SocketClient: Adding handler for event: disconnect 7/3/15 9:48:35.092 AM swiftTest[3295]: SocketClient: Adding handler for event: reconnect 7/3/15 9:48:35.093 AM swiftTest[3295]: SocketClient: Adding handler for event: reconnectAttempt 7/3/15 9:48:35.093 AM swiftTest[3295]: SocketClient: Adding handler for event: message 7/3/15 9:48:35.093 AM swiftTest[3295]: SocketClient: Adding handler for event: connection 7/3/15 9:48:35.094 AM swiftTest[3295]: SocketClient: Adding handler for event: event 7/3/15 9:48:35.094 AM swiftTest[3295]: SocketClient: Adding engine 7/3/15 9:48:35.094 AM swiftTest[3295]: SocketEngine: Starting engine 7/3/15 9:48:35.094 AM swiftTest[3295]: SocketEngine: Handshaking 7/3/15 9:48:35.095 AM swiftTest[3295]: SocketEngine: Doing polling request 7/3/15 9:48:35.303 AM swiftTest[3295]: SocketEngine: Got polling response 7/3/15 9:48:35.311 AM swiftTest[3295]: ERROR SocketEngine: Parsing error: <!DOCTYPE html>
404. That’s an error.
The requested URL
/socket.io/
was not found on this server. That’s all we know. 7/3/15 9:48:35.312 AM swiftTest[3295]: ERROR SocketClient: Error parsing XHR message 7/3/15 9:48:35.312 AM swiftTest[3295]: SocketClient: Handling event: error with data: ( "Error parsing XHR message" ) 7/3/15 9:48:35.313 AM swiftTest[3295]: SocketClient: Handling event: reconnect with data: ( "Error parsing XHR message" ) 7/3/15 9:48:35.313 AM swiftTest[3295]: SocketClient: Starting reconnect 7/3/15 9:48:35.313 AM swiftTest[3295]: SocketClient: Trying to reconnect 7/3/15 9:48:35.314 AM swiftTest[3295]: SocketClient: Handling event: reconnectAttempt with data: ( "-1" ) 7/3/15 9:48:35.314 AM swiftTest[3295]: SocketClient: Adding engine 7/3/15 9:48:35.314 AM swiftTest[3295]: SocketEngine: Starting engine 7/3/15 9:48:35.315 AM swiftTest[3295]: SocketEngine: Handshaking 7/3/15 9:48:35.315 AM swiftTest[3295]: SocketEngine: Doing polling request 7/3/15 9:48:35.315 AM swiftTest[3295]: SocketEngine: Engine is being deinit 7/3/15 9:48:35.323 AM swiftTest[3295]: socket error 7/3/15 9:48:35.324 AM swiftTest[3295]: socket reconnect 7/3/15 9:48:35.324 AM swiftTest[3295]: socket reconnectAttempt 7/3/15 9:48:35.491 AM swiftTest[3295]: SocketEngine: Got polling response 7/3/15 9:48:35.496 AM swiftTest[3295]: socket error 7/3/15 9:48:35.497 AM swiftTest[3295]: ERROR SocketEngine: Parsing error:404. That’s an error.
The requested URL
/socket.io/
was not found on this server. That’s all we know. 7/3/15 9:48:35.497 AM swiftTest[3295]: ERROR SocketClient: Error parsing XHR message 7/3/15 9:48:35.498 AM swiftTest[3295]: SocketClient: Handling event: error with data: ( "Error parsing XHR message" ) 7/3/15 9:48:40.346 AM com.apple.launchd.peruser.501[178]: (com.convo.swiftTest.75008[3295]) Job appears to have crashed: Segmentation fault: 11 7/3/15 9:48:40.441 AM ReportCrash[3298]: Saved crash report for swiftTest[3295] version 1.0 (1) to /Users/xxx/Library/Logs/DiagnosticReports/swiftTest_2015-07-03-094840_xxx-Mac-mini.crash ``` ```