Ezelia / eureca.io

eureca.io : a nodejs bidirectional RPC that can use WebSocket, WebRTC or XHR fallback as transport layers
http://eureca.io/
343 stars 30 forks source link

Dealing with server disconnect on the client #8

Closed fyyyyy closed 9 years ago

fyyyyy commented 9 years ago

Hey, im using eureca in this project and it works really well. If do get a server shutdown & restart, e.g. i'm pushing a new build, how would i detect that on the client side ?

Thanks

alaa-eddine commented 9 years ago

hi @fyyyyy really greate project :) I will share it on our FB page (https://www.facebook.com/Ezelia.games) ;)

about your issue, if the server disconnect for few seconds to few minutes, the client will try to automatically reconnect to the server, you don't have to do anything.

if you really want to detect disconnection/retries events (for example to display notify the user) you can use onConnectionLost, onConnectionRetry and onDisconnect see this example: https://github.com/Ezelia/eureca.io/blob/master/examples/99-bidirectional-calls/client.js

fyyyyy commented 9 years ago

ok, thanks for sharing :) Cool that's what i need :+1: