feat: 三代机中心udp过滤
This commit is contained in:
		
							parent
							
								
									d19ae7d5f5
								
							
						
					
					
						commit
						30aee68389
					
				@ -88,7 +88,11 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
      //   time:dateFormat(new Date()),
 | 
					      //   time:dateFormat(new Date()),
 | 
				
			||||||
      //   PLC:`${TAG} getUDPudp rebind success`,
 | 
					      //   PLC:`${TAG} getUDPudp rebind success`,
 | 
				
			||||||
      // })
 | 
					      // })
 | 
				
			||||||
 | 
					      const terType = this.retClass.terType
 | 
				
			||||||
 | 
					      //TODO 临时处理过滤掉中心udp
 | 
				
			||||||
 | 
					      if(localIpPort != '8800' && terType == 2){
 | 
				
			||||||
        this.udp && this.udp.on('message', this.message_1Fn);
 | 
					        this.udp && this.udp.on('message', this.message_1Fn);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }).catch(err => {
 | 
					    }).catch(err => {
 | 
				
			||||||
      //globalThis.closeHeartSocket=true
 | 
					      //globalThis.closeHeartSocket=true
 | 
				
			||||||
      this.isWorking = false
 | 
					      this.isWorking = false
 | 
				
			||||||
@ -105,12 +109,17 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
      address: this.localIp, port: parseInt(this.localIpPort), family: 1
 | 
					      address: this.localIp, port: parseInt(this.localIpPort), family: 1
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    promise.then(() => {
 | 
					    promise.then(() => {
 | 
				
			||||||
 | 
					      const localIpPort = this.localIpPort
 | 
				
			||||||
      this.isWorking = true
 | 
					      this.isWorking = true
 | 
				
			||||||
      // this.writeLog({
 | 
					      // this.writeLog({
 | 
				
			||||||
      //   time:dateFormat(new Date()),
 | 
					      //   time:dateFormat(new Date()),
 | 
				
			||||||
      //   PLC:`${TAG} getUDPudp bind success`,
 | 
					      //   PLC:`${TAG} getUDPudp bind success`,
 | 
				
			||||||
      // })
 | 
					      // })
 | 
				
			||||||
 | 
					      const terType = this.retClass.terType
 | 
				
			||||||
 | 
					      //TODO 临时处理过滤掉中心udp
 | 
				
			||||||
 | 
					      if(localIpPort != '8800' && terType == 2){
 | 
				
			||||||
        this.udp && this.udp.on('message', this.message_1Fn);
 | 
					        this.udp && this.udp.on('message', this.message_1Fn);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }).catch(err => {
 | 
					    }).catch(err => {
 | 
				
			||||||
      this.isWorking = false
 | 
					      this.isWorking = false
 | 
				
			||||||
      console.info('surenjun err=>', JSON.stringify(err))
 | 
					      console.info('surenjun err=>', JSON.stringify(err))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user