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"
2424import { useTargetContext } from "../targets"
2525
2626let counterNoAnswer = 0
27+ const MaxNoAnswerNb = 4
28+
2729/*
2830 * Local const
2931 *
@@ -105,7 +107,8 @@ const HttpQueueContextProvider = ({ children }) => {
105107 } else {
106108 if ( ! e . code ) {
107109 counterNoAnswer ++
108- if ( counterNoAnswer > 3 ) {
110+ console . log ( "Connection lost ?" , counterNoAnswer )
111+ if ( counterNoAnswer > MaxNoAnswerNb ) {
109112 Disconnect ( "connectionlost" )
110113 }
111114 }
Original file line number Diff line number Diff line change @@ -170,8 +170,12 @@ const WsContextProvider = ({ children }) => {
170170 //seems sometimes it disconnect so wait 3s and reconnect
171171 //if it is not a log off
172172 if ( ! isLogOff . current ) {
173- if ( ! isPingPaused ) reconnectCounter . current ++
173+ if ( ! isPingPaused ) {
174+ reconnectCounter . current ++
175+ console . log ( "reconnecting " , reconnectCounter . current )
176+ }
174177 if ( reconnectCounter . current >= maxReconnections ) {
178+ console . log ( "Reconnection over " , maxReconnections )
175179 Disconnect ( "connectionlost" )
176180 } else {
177181 console . log ( "Ws connection lost" )
You can’t perform that action at this time.
0 commit comments