Closed ahallora closed 9 years ago
I'm having difficulty reproducing, because once you turn off the server, the client should immediately try and reconnect once and fail. It'll then wait 5 seconds and fail again. Then it'll wait 5 more seconds and try again, which depending on whether you've started the server by now will either fail and then succeed the next try, or succeed now.
Also there isn't any undocumented options, they're all listed here https://github.com/socketio/socket.io-client-swift#options
First of all, I love the stability gained from using this new wonderful library! It's quicker and more reliable than the unofficial framework I used before. :+1:
However, i'm experiencing a glitch which causes multiple
reconnectionAttempts
to trigger adisconnect
-event on the server for the failed attempts. It is best described with an example.The case is this: 1) SwiftIO is connected to a node socket.io server - it's all good 2) I stop the server, wait 10 seconds, and start the server again 3) SwiftIO starts reconnecting - in this example it triggers
reconnectAttempt
3 times before reconnecting 4) The server acknowledges all 3 attempts by triggering theconnection
-event on the server 3 times 5) After approx. 25 seconds thedisconnect
-event is triggered on the server for the 2 failed reconnectsMy iOS code (in obj-c sorry):
My server code looks like this:
Is it working as intended? I don't think that a
disconnect
event should be triggered on failed connection attempts - e.g. there's no connection ergo no disconnect to invoke. :smile: