Compare commits
2 Commits
7c57ba3e93
...
7dfc959aa2
| Author | SHA1 | Date | |
|---|---|---|---|
| 7dfc959aa2 | |||
| 2a588d5d7c |
Binary file not shown.
@ -109,12 +109,6 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
|
|||||||
await fileUtil.initFolder(filePath);
|
await fileUtil.initFolder(filePath);
|
||||||
fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify(temp) + `\n`);
|
fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify(temp) + `\n`);
|
||||||
}
|
}
|
||||||
// const {code} = temp;
|
|
||||||
// if(code == '2300007' || code == '2300028'){
|
|
||||||
// return await writeObjectOut(params,filePath)
|
|
||||||
// }else{
|
|
||||||
// return temp
|
|
||||||
// }
|
|
||||||
return temp
|
return temp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export default class TcpClient {
|
|||||||
//重连次数
|
//重连次数
|
||||||
private folderPath
|
private folderPath
|
||||||
|
|
||||||
private tcp: any = null
|
private tcp: socket.TCPSocket = null
|
||||||
|
|
||||||
constructor(tcplocalIp: string, tcplocalIpPort: string, tcpOppositeIp: string, tcpOppositePort: string) {
|
constructor(tcplocalIp: string, tcplocalIpPort: string, tcpOppositeIp: string, tcpOppositePort: string) {
|
||||||
this.localIp = tcplocalIp
|
this.localIp = tcplocalIp
|
||||||
@ -65,7 +65,7 @@ export default class TcpClient {
|
|||||||
this.tcp.connect({
|
this.tcp.connect({
|
||||||
address: {
|
address: {
|
||||||
address: this.oppositeIp, port: Number(this.oppositeIpPort), family: 1
|
address: this.oppositeIp, port: Number(this.oppositeIpPort), family: 1
|
||||||
}, timeout: 6000
|
}, timeout: 1000 * 15
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.tcp.setExtraOptions({
|
this.tcp.setExtraOptions({
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
@ -148,7 +148,7 @@ export default class TcpClient {
|
|||||||
|
|
||||||
offTcp(callback) {
|
offTcp(callback) {
|
||||||
console.log(TAG, 'tcpofff')
|
console.log(TAG, 'tcpofff')
|
||||||
this.tcp.off('testTagofmessg', callback);
|
this.tcp.off('message', callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
closeTcp(callback) {
|
closeTcp(callback) {
|
||||||
|
|||||||
@ -342,9 +342,6 @@ export default struct SignDisplayCom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async aboutToAppear() {
|
async aboutToAppear() {
|
||||||
// const fileUtil = new FileUtil(globalThis.context)
|
|
||||||
// const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt')
|
|
||||||
// this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170'
|
|
||||||
this.ratio = this.ratio * (this.scaleNum || 1);
|
this.ratio = this.ratio * (this.scaleNum || 1);
|
||||||
const {showBack,getSignal} = this
|
const {showBack,getSignal} = this
|
||||||
|
|
||||||
|
|||||||
@ -607,7 +607,7 @@ export default class Judge {
|
|||||||
const temp = await writeObjectOut(data, filePath);
|
const temp = await writeObjectOut(data, filePath);
|
||||||
console.log("wzj", JSON.stringify(temp))
|
console.log("wzj", JSON.stringify(temp))
|
||||||
//断网&网络超时次数计算
|
//断网&网络超时次数计算
|
||||||
if (temp.code == 2300007 || temp.code == 2300028) {
|
if (temp.code != 1) {
|
||||||
this.disConnectNum += 1;
|
this.disConnectNum += 1;
|
||||||
if (this.disConnectNum < 5) {
|
if (this.disConnectNum < 5) {
|
||||||
return await this.sendWriteObjectOut(data, filePath)
|
return await this.sendWriteObjectOut(data, filePath)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user