socketio / socket.io-client-swift

Other
5.22k stars 842 forks source link

Question: Should currentReconnectAttempt reset upon call connect on SocketIOClient or SocketManager #1368

Closed sbhmajd closed 2 years ago

sbhmajd commented 3 years ago

Socket.IO-Client-Swift Version: 15.2.0 Xcode Version 12.5.1 iOS target 11, running on simulator 14.5

What I'm doing for testing:

First I define the socket manager with config ( reconnects(true), reconnectWait(2), reconnectAttempts(3) ) and host (ex: https://echo.websocket.org)

Then Im trying to call connect using default socket from the manager

Of course it will not connect and try reconnectAttempt correctly 3 times with 2 seconds in between each attempt, then fail event each time with final disconnected event as (["Reconnect Failed"]).

After that I try again to call connect again, it will just fail event once and nothing more.

So my question here: It should reset the the number of attempts or not when call connect (or disconnect), to keep same behaviour as first call of connect?

Also does this behaviour of reconnects and attempt support multi namespaces sockets?

Regrads,