Closed piofficetwo closed 9 years ago
How are you disconnecting the client?
I am disconnecting the client by shutting down the server. The server is running on nodejs.
Not sure if it matters, but are you using this from Objective-C?
Also does this always happen?
I am using objective-C but I don't think it is related to socketIO. I am wrapping around the swift library and then using this wrapped library in my objective-C class. However, I am not dealing with the reconnection at any point.
This happens 100% of the time with the exact same error.
If I just comment out this line:
handleEvent("reconnect", data: [reason], isInternalMessage: true)
Then the app crashes here:
handleEvent("reconnectAttempt", data: [reconnectAttempts - currentReconnectAttempt],
isInternalMessage: true)
I think this line is crashing the program:
What is interesting is that this error happens once in a while upon some other events as well, but for those events, the crash is inconsistent and only happens once every 10-20 times.
EDIT: Actually now thinking about it, I think it only crashes on connection for events that are not reconnects
Hm, I'm having trouble reproducing from Swift. Shutting down the server while it's connected doesn't seem to cause any crashes for me.
Do you know why this might be happening? Perhaps I am doing something wrong but currently I really have no idea why it might fail
My objective-c test project doesn't seem to crash either. You said you're wrapping around the library. What does that mean?
I am trying to make my program resend data up to 5 times if the client does not receive the data. I want this to apply to many different scenarios so I wrapped the socket and made the behaviour so that it resends it up to 5 times until a confirmation is received.
Just wondering, if I use "onAny", does this interfere with anything such as the reconnect?
I would think that the client should always get the data, since it uses TCP. And onAny shouldn't affect anything.
I got the error! It has nothing to do with the library so don't worry.
Thanks for your help btw!
I am not very good with IOS programming so bare with me. I am not sure what is happening, but when I disconnect the server, the client tries to reconnect and this crashes the app with this:
Yet, when I comment these two lines out:
The app does not crash. Any idea on why this is happening?