mirror of
https://github.com/mik3y/usb-serial-for-android.git
synced 2026-08-23 06:12:59 +00:00
new SerialInputOutputManager.start() method
Previously recommended start action `Executors.newSingleThreadExecutor().submit(ioManager)` did not shutdown the Executor, which caused a thread leak. It's still possible to use old style start, as SerialInputOutputManager continues to implement Runnable interface.
This commit is contained in:
@@ -81,7 +81,7 @@ then use direct read/write
|
||||
or direct write + event driven read:
|
||||
```java
|
||||
usbIoManager = new SerialInputOutputManager(usbSerialPort, this);
|
||||
Executors.newSingleThreadExecutor().submit(usbIoManager);
|
||||
usbIoManager.start();
|
||||
...
|
||||
port.write("hello".getBytes(), WRITE_WAIT_MILLIS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user