FengChendian / serial_port_win32

A flutter SerialPort library using win32 API.
BSD 3-Clause "New" or "Revised" License
30 stars 8 forks source link

Change WaitForSingleObject to non-blocked #16

Closed zhang-peter closed 2 years ago

zhang-peter commented 2 years ago

WaitForSingleObject(_over.ref.hEvent, 500) may block thread in 500ms. That case will result in a bad experience in UI application.

FengChendian commented 2 years ago

Do you mean using a for loop instead of block? Maybe it's a good idea. I will merge it and test.