Open Simon-ReScan opened 5 years ago
@Re-scan Thanks for the very detailed writeup! I have a PR out now with a fix for this.
Does the 4.0.3 release include the fix for this?
@schwartztr The new USB Transport no longer uses this method to read packets. This problem should be resolved in 4.0.3.
I can confirm this issue is not resolved in 4.0.3. My program is using 4.0.3 and It has the same exact problem.
We are experiencing an intermittent issue in production, where the Clover will accept messages from the POS but the POS does not get messages from the Clover. In event viewer we found the following events, just before this happens
We managed to track this down to
getMessages()
inUSBCloverTransport.cs
, this method callsreceiveString()
, ifreceiveString()
raises an exceptiongetMessages()
exits its loop and the POS will no longer receive messages.This results is the POS been able to initiate a payment on the Clover and the Cover been able to process the payment, but the payment response will never make it back to the POS.
In the case of the above error, we believe this is down to the
UsbEndpointReader
, calling Read on line 959 of thereadPacket()
method, and having an unexpected result withnumBytesRead
still been zero, this in turn raise an exception, to break out of the loop, which is sollowed up by the empty try-catch, losing the reason for the failure.As
numBytesRead
is zero it then raises an exception on line 977, this is the error we are seeing in event viewer.We have been able to replicate this by setting a break point at line 961 and setting
ecRead = UnknownError
andnumBytesRead = 0
. After this the POS can still communicate with the Clover, but the Clover and no longer communicate with the POS.We are using v4.0.2 / .net 4.5 and have seen this on both Windows 7 & 10