You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our experience shows that disconnections are common even on a stable Internet connection. So even when we used 2.x version we don't really listen to reconnecting event or reconnect. What we really care is whether socket instance is connected or not and maybe more importantly whether message is delivered or not.
Then we noticed since 3.x the socket instance does not emit any event related to the reconnection logic anymore. I think that, among other things, confirmed how we used socket instance in 2.x.
So when I check these reconnect events on manager I am not sure the use case of them,
socket.io.on("reconnect", (attempt) => {}); why don't we just use socket.on("connect", () => {}); Yes I can let user know this is the attemptth time retry that it finally connects, but do my user really care ?
socket.io.on("reconnect_attempt", (attempt) => {}); maybe some UI indication ? But anything other than that ?
socket.io.on("reconnect_error", (error) => {}); maybe some UI indication ? But anything other than that ?
socket.io.on("reconnect_failed", () => {});. Of the 4 reconnect events, this is the only one I think I may use. It is fired when couldn't reconnect within reconnectionAttempts, so I can may stop and let the user know.
The reconnecting event exists in 2.x was dropped in 4.x. I totally agree with that. I can't think of the use of it.
So except for some UI indication, what are other use case we (as the user of socket.io ) can use?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Our experience shows that disconnections are common even on a stable Internet connection. So even when we used 2.x version we don't really listen to
reconnecting
event orreconnect
. What we really care is whether socket instance is connected or not and maybe more importantly whether message is delivered or not.Then we noticed since 3.x the socket instance does not emit any event related to the reconnection logic anymore. I think that, among other things, confirmed how we used socket instance in 2.x.
So when I check these reconnect events on manager I am not sure the use case of them,
socket.io.on("reconnect", (attempt) => {});
why don't we just usesocket.on("connect", () => {});
Yes I can let user know this is theattempt
th time retry that it finally connects, but do my user really care ?socket.io.on("reconnect_attempt", (attempt) => {});
maybe some UI indication ? But anything other than that ?socket.io.on("reconnect_error", (error) => {});
maybe some UI indication ? But anything other than that ?socket.io.on("reconnect_failed", () => {});
. Of the 4 reconnect events, this is the only one I think I may use. It is fired when couldn't reconnect withinreconnectionAttempts
, so I can may stop and let the user know.reconnecting
event exists in 2.x was dropped in 4.x. I totally agree with that. I can't think of the use of it.So except for some UI indication, what are other use case we (as the user of socket.io ) can use?
Beta Was this translation helpful? Give feedback.
All reactions