Skip to content

POS stops receiving messages if USBCloverTransport .receiveString() raises an error #52

@Simon-ReScan

Description

@Simon-ReScan

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

14:13:10 - receiveMessagesThread Exception: Read failed, 0 bytes returned
14:13:10 - 4 : Terminating receiveMessagesThread

We managed to track this down to getMessages() in USBCloverTransport.cs, this method calls receiveString() , if receiveString() raises an exception getMessages() 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 the readPacket() method, and having an unexpected result with numBytesRead 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 and numBytesRead = 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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions