1
0
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:
kai-morich
2021-04-16 17:33:41 +02:00
parent 848d4e7713
commit 128d1a00b1
5 changed files with 56 additions and 14 deletions
+1 -1
View File
@@ -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);