Pi4J / pi4j-v2

Pi4J Version 2.0
Apache License 2.0
266 stars 54 forks source link

Use Socket#setSoTimeout to timeout read requests of GPIO socket implementation #305

Closed IAmNickNack closed 9 months ago

IAmNickNack commented 9 months ago

It seems unnecessary to need to implement logic to wait 500ms for a data packet when the Java Socket implementation provides setSoTimeout for a similar purpose.

Could the implementation be simplified if setSoTimeout were used rather than blocking with Thread.sleep in user code?

eitch commented 9 months ago

I totally agree, your PR #306 is pending

eitch commented 9 months ago

Your PR is merged