-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZKError: TIMEOUT_ON_WRITING_MESSAGE upon client socket reconnect. #27
Comments
Hello, did you solve the problem?. That happens to me too |
Tengo el mismo problema. |
same problem when try zkInstance.getTime() |
|
I fixed it you just need to remove await in the timeout method and it works perfectly fine for me The code is in zklibtcp.js file: writeMessage(msg, connect) {
return new Promise((resolve, reject) => {
let timer = null
this.socket.once('data', (data) => {
timer && clearTimeout(timer)
resolve(data)
})
this.socket.write(msg, null, async (err) => {
if (err) {
reject(err)
} else if (this.timeout) {
timer = setTimeout(() => {
clearTimeout(timer);
reject(new Error('TIMEOUT_ON_WRITING_MESSAGE'));
}, connect ? 2000 : this.timeout)
}
})
})
} I updated some functionalities and resolved most of the issues in my module based on this package |
had anyone solve it yet? I have the same issue with some devices and not all of them |
My case is my ZKteco G2 was offline so i can't make a TCP connect to it, even though i can ping to the device 's IP. So make sure your device is online and be abled to connect. And If other computer is connecting to the attendence device, you still can connect to it by TCP, i dont use UDP so i don't know if it worked. |
Good day! I'm attempting to connect multiple devices and use socket.io to emit data to client side. At first load of the server everything works fine, It say's "ok tcp" and "ok udp" but after/upon reloading the client app im having a problem with the udp type device. Here is the error:
Here is my code below:
Thank you in advance for the help!
The text was updated successfully, but these errors were encountered: