Closed meron1122 closed 5 years ago
What line of code caused the error? This may be another bug that is not necessarily an overflow.
I think a lot could be done to improve the library by emitting events. But in this case I don't think we have received a TCP disconnect from node. When you disconnect the PLC, are you turning it off but leaving your computer connected to the network? If so, the TCP disconnect is difficult to detect, but "anythingBad" will be true due to the timeout error.
In programs where I have used this routine, I have always waited until previous reads/writes return before calling another. Normally this is in milliseconds, but when you cut communication this can take a couple of seconds.
I will try to test this as well, maybe this weekend.
I am closing this as improvements have been made on handling errors since this bug was reported. If you are still seeing this issue please re-open.
I send lifeBit to PLC like this
Read int, and write negated.
If I "cut off" ethernet, after some time,(I think overflow queue?) libary throws uncaught Exception. Error:
TypeError: Cannot read property 'length' of undefined
Log:
It be very good if libary throw message for example:
Best Regards, and thanks again for libary!