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
Mostly on android and iOS (and desktop when computer goes to sleep). The client pauses and after a minute the client is logged out on the Deepstream server. When the client is waken up again it (the Deepstream client) doesn’t know it is disconnected. After a minute of a weird in-between-state it realizes it is disconnected and reconnects.
Following is some code that forces a reconnect ( won't run copy/paste )
var latestHeartBeat = Date.now();
var engine = dsClient._connection.endpoint;
if (!.isUndefined(engine.onHeartbeat)) {
var onHeartBeat = function () {
latestHeartBeat = Date.now();
};
engine.on('heartbeat', onHeartBeat);
var browserAwake = function () {
if (Date.now() - latestHeartBeat > 30000) {
dsClient._connection._endpoint.onClose('ping timeout');
}
};
bus.on( 'browser_awake', browserAwake );
The text was updated successfully, but these errors were encountered:
Mostly on android and iOS (and desktop when computer goes to sleep). The client pauses and after a minute the client is logged out on the Deepstream server. When the client is waken up again it (the Deepstream client) doesn’t know it is disconnected. After a minute of a weird in-between-state it realizes it is disconnected and reconnects.
Following is some code that forces a reconnect ( won't run copy/paste )
var latestHeartBeat = Date.now();
var engine = dsClient._connection.endpoint;
if (!.isUndefined(engine.onHeartbeat)) {
var onHeartBeat = function () {
latestHeartBeat = Date.now();
};
engine.on('heartbeat', onHeartBeat);
var browserAwake = function () {
if (Date.now() - latestHeartBeat > 30000) {
dsClient._connection._endpoint.onClose('ping timeout');
}
};
bus.on( 'browser_awake', browserAwake );
The text was updated successfully, but these errors were encountered: