Merge branch 'dev_tcp2byte' of http://47.122.70.237:3000/harmony_car/subject-two into dev_tcp2byte
This commit is contained in:
		
						commit
						27db86cf2a
					
				| @ -18,10 +18,26 @@ const config = { | ||||
|   port: 40000 | ||||
| } | ||||
| 
 | ||||
| const singleTcpClient = (function () { | ||||
|   let instance; | ||||
|   function createInstance() { | ||||
|     return socket.constructTCPSocketInstance() | ||||
|   } | ||||
| 
 | ||||
|   return { | ||||
|     getClient: function () { | ||||
|       if (!instance) { | ||||
|         instance = createInstance(); | ||||
|       } | ||||
|       return instance | ||||
|     } | ||||
|   }; | ||||
| })(); | ||||
| 
 | ||||
| export default async function tcp2ByteRequest(data): Promise<RES> { | ||||
| 
 | ||||
|   return new Promise(async (resolve, reject) => { | ||||
|     const tcpClient: socket.TCPSocket = socket.constructTCPSocketInstance() | ||||
|     const tcpClient: socket.TCPSocket = singleTcpClient.getClient() | ||||
| 
 | ||||
|     const {address,port} = config | ||||
|     const tcp2Byte = new TcpToByte() | ||||
|  | ||||
| @ -324,7 +324,7 @@ export default class TcpToByte { | ||||
|     //考试路线
 | ||||
|     const ksxl = str2UTF8(temp.ksxl) | ||||
|     //考车号码
 | ||||
|     const kchp = str2UTF8(temp.kchp) | ||||
|     // const kchp = str2UTF8(temp.kchp)
 | ||||
| 
 | ||||
|     const time = timeTOBCD(temp.jssj) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user