File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ import { useWsContext } from "./WsContext"
24
24
import { useTargetContext } from "../targets"
25
25
26
26
let counterNoAnswer = 0
27
+ const MaxNoAnswerNb = 4
28
+
27
29
/*
28
30
* Local const
29
31
*
@@ -105,7 +107,8 @@ const HttpQueueContextProvider = ({ children }) => {
105
107
} else {
106
108
if ( ! e . code ) {
107
109
counterNoAnswer ++
108
- if ( counterNoAnswer > 3 ) {
110
+ console . log ( "Connection lost ?" , counterNoAnswer )
111
+ if ( counterNoAnswer > MaxNoAnswerNb ) {
109
112
Disconnect ( "connectionlost" )
110
113
}
111
114
}
Original file line number Diff line number Diff line change @@ -170,8 +170,12 @@ const WsContextProvider = ({ children }) => {
170
170
//seems sometimes it disconnect so wait 3s and reconnect
171
171
//if it is not a log off
172
172
if ( ! isLogOff . current ) {
173
- if ( ! isPingPaused ) reconnectCounter . current ++
173
+ if ( ! isPingPaused ) {
174
+ reconnectCounter . current ++
175
+ console . log ( "reconnecting " , reconnectCounter . current )
176
+ }
174
177
if ( reconnectCounter . current >= maxReconnections ) {
178
+ console . log ( "Reconnection over " , maxReconnections )
175
179
Disconnect ( "connectionlost" )
176
180
} else {
177
181
console . log ( "Ws connection lost" )
You can’t perform that action at this time.
0 commit comments