Constructors
constructor
- new UDPReqResClient(ip, port, requestTimeout, retryCount): UDPReqResClient
Parameters
- ip: string
- port: number
- requestTimeout: number
- retryCount: number
Properties
Private
client
client: Socket
Private
counter
counter: number
Private
requestTimeout
requestTimeout: number
Private
retryCount
retryCount: number
Methods
Private
basicRequest
- basicRequest<T>(data, reqId): Promise<T>
Parameters
- data: Buffer
- reqId: number
Returns Promise<T>
close
- close(): void
Returns void
request
- request<T>(data): Promise<T>
Parameters
- data: Record<string, unknown>
Returns Promise<T>
Private
withRetry
- withRetry<T>(req, count?, err?): Promise<T>
Parameters
- req: (() => Promise<T>)
- (): Promise<T>
Returns Promise<T>
- count: number = 0
Optional
err: string
Returns Promise<T>
UDP client used for communication with the device.