重连日志添加
This commit is contained in:
parent
5d2e6cc6df
commit
03d28117cc
@ -3,6 +3,8 @@ import { getSyncData } from '../service/initable';
|
||||
import hilog from '@ohos.hilog';
|
||||
import FileUtil from '../../common/utils/File'
|
||||
import { GlobalConfig } from '../../config/index'
|
||||
const TAG = 'socketTag[TcpDemo.TcpClient]'
|
||||
|
||||
export async function getTCP(flag=false) {
|
||||
globalThis.getCloseTcp=true
|
||||
const fileUtil = new FileUtil(globalThis.context)
|
||||
@ -34,6 +36,8 @@ export async function getTCP(flag=false) {
|
||||
await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
|
||||
globalThis.tcpStep+=1
|
||||
if(globalThis.tcpStep>30){
|
||||
console.log(TAG,'tcp重连开始')
|
||||
globalThis.tcpStep=0
|
||||
getTCP()
|
||||
}
|
||||
}
|
||||
@ -73,7 +77,9 @@ export async function getTCP(flag=false) {
|
||||
await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
|
||||
globalThis.tcpStep+=1
|
||||
if(globalThis.tcpStep>30){
|
||||
globalThis.tcpStep=0
|
||||
getTCP()
|
||||
console.log(TAG,'tcp重连开始')
|
||||
}
|
||||
}
|
||||
},1000/3)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user