Comments (4)
Hi,
We cache successful transport info - it is flushed after 15 minutes or after an unsuccessful attempt using the cached transport. We also disable WebSockets/Flash if there were 2 established connections that closed uncleanly after less than a few minutes (right now 4 minutes, I think).
In other cases, current strategy is:
- start connecting with WebSockets,
- wait 2 seconds,
- if WebSockets haven't connected yet, start connecting using SockJS in parallel.
There are lots of cases this behaviour makes sense. There are proxies that break connections after a longer period, so you will manage to open a WebSocket connection every time, but you'll have to reconnect every minute, which is much worse than being switched to HTTP.
Anyway, for majority of cases you don't experience this behaviour and everything works fine. We will consider upgrading transports on the fly in the future, but we can't implement this reliably for the time being.
In the meantime, we'll be releasing blog posts about current strategy soon, which will give you more details on the strategy and motivations behind it.
from pusher-js.
Hey, thanks for the detailed info.
Just to be completely clear, I'm testing by switching off the WIFI connection on my laptop for a few seconds and then reenabling it. So, complete loss of connectivity, and then everything back to normal.
So the behaviour I described above is expected under those circumstances?
Looking forward to the blog post with details on the strategy!
from pusher-js.
Yes, this is expected behaviour, it's used to detect bad proxies or anti-virus software, which behave in very similar ways. Normally, you don't experience frequent network disconnections and even if you do, you're probably better off with polling.
We should release the first, more general blog post today and two more detailed in 1 week intervals.
from pusher-js.
Blog posts about connection strategy are here:
http://blog.pusher.com/how-we-built-pusher20-part-1/
http://blog.pusher.com/how-we-built-pusher-js-2-0-part-2-implementation/
http://blog.pusher.com/how-we-built-pusher-js-2-0-part-3-metrics/
I'm closing, since there's no action to be done for this issue.
from pusher-js.
Related Issues (20)
- PWA HOT 1
- Constant connection state changes when using other than ws transports HOT 3
- Not actuall stats HOT 6
- Pusher-JS doesnt play well with NextJS 14 : Uncaught SyntaxError: Unexpected token ':' HOT 3
- Providing Custom Handler, Internal Endpoint Still Calls
- Pusher client is not binding correctly on presence channels but on public ones yes HOT 2
- Pusher websocket URL triggering events and sending data HOT 1
- This is a test.
- testing
- PageSpeed Insights Failed: net::ERR_NAME_NOT_RESOLVED HOT 2
- Feature - Attach additional params in `subscribe` method for channel auth
- test123
- test bracatinga
- test samambaia
- test araucaria
- test pinus grandis
- test hortencia
- test hoverboat
- await pusher.get() returning unresolved promise
- Is pusherjs still under active development?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pusher-js.