Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> does SockJS do reconnects?

No. WebSocket API doesn't do automatic reconnects. Also, it is impossible to get have it built-in: every single application will need to behave differently after reconnection! For example - you may want to make sure that your web app synchronised state after the reconnection (and that's very application specific thing).

So, as with WebSockets, reconnecting is your responsibility. You're free to implement exponential backoff or any other thing you want. Frankly - that's quite simple.

> does SockJS do heartbeats?

SockJS server is expected to send simple frames once in a while to make sure that load balancer won't kill the long-polling connection. But this is not exposed to the user.

Again, WebSocket API does not expose heartbeats AFAIK. And once again, implementing that on the application layer is not terribly complex and allows you to have behaviour that perfectly suits your needs.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: