Hi again @pladaria,
Im unable to get connected when make to fast manual close and reconnect operations the flag _connectLock keep in true and breaks the next connect call.
You cold try the following example:
const ws = null;
const _connect = () => {
if (!ws) {
// create one-time websocket instance
ws = new ReconnectingWebSocket(Settings.WEBSOCKET_URL, [], {
// https://github.com/pladaria/reconnecting-websocket#available-options
debug: __DEV__
});
// stubs
} else {
ws.reconnect();
}
}
const _disconnect = () => {
if (ws) {
ws.close();
}
}
// test
_connect();
_disconnect();
_connect();
_disconnect();
_connect();
_disconnect();
_connect();
// the connection keeps in wrong state with _connectLock in true and never connect
Hi again @pladaria, Im unable to get connected when make to fast manual close and reconnect operations the flag
_connectLock
keep in true and breaks the next connect call.You cold try the following example:
Thanks !!!