Skip to content
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

How to close the device? #72

Open
sargue opened this issue May 21, 2020 · 0 comments
Open

How to close the device? #72

sargue opened this issue May 21, 2020 · 0 comments

Comments

@sargue
Copy link

sargue commented May 21, 2020

Javadocs for HidDevice say:

Each HidDevice instance creates an internal background thread to perform some work in the background. This thread may keep an application that uses PureJavaHidApi from exiting if the device is not closed before the application tries to exit.

And for the close() method:

This call may block indefinitely if the device stops sending reports. (Hopefully in the future the close method will not block under any circumstances).

So, how is the proper way to close() a device?

My preliminary tests show that the close() method is almost unusable if the device doesn't send reports on its own. Fortunately seems like the first warning about a thread preventing the app to exit is not preventing VM in our case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant