2 ms·
sounds like you did not really evaluate both technologies at the heart but only some libraries on top?
by jFriedensreich 5y ago
sounds like you did not really evaluate both technologies at the heart but only some libraries on top?
- szastamasta 5y agoYeah, sorry. In socket.io it’s 2 lines. You need 5 lines with browser APIs :). You simply get stuff like auto-reconnect and graceful failover to long polling for free when using socket.io
- tekknik 5y ago2 lines vs 5 lines. did you check your payload size after adding socket.io? you added way more than 2 lines. long polling shouldn’t be needed anymore, and auto reconnect is trivial to implement.
- coder543 5y agoSSE EventSource also has built-in auto-reconnect, and it doesn’t even need to support failover to long polling. Neither of those being built into a third party websocket library are actually advantages for websocket… they just speak to the additional complexity of websocket. Plus, long polling as a fallback mechanism can only be possible with server side support for both long polling and websocket. Might as well just use SSE at that point.