rodel-talampas / java-simple-serial-connector

Automatically exported from code.google.com/p/java-simple-serial-connector
0 stars 0 forks source link

implement write timeout #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
A write operation is blocking endless when a virtual port is removed during a 
write operation. It unblocks only if SerialPort.closePort() will be called by 
an other thread.

Original issue reported on code.google.com by chriss....@gmail.com on 29 Oct 2012 at 9:43

GoogleCodeExporter commented 9 years ago
Some thougs about implementation variants:

1. void write(byte[] data,long writeTimeoutMs)
   Writes the data and wait at most writeTimeoutMs milliseconds to resume, otherwise an    IOException or a Subtype will be thrown eg. IOTimeoutException

2. Future<Integer> write(byte[] data)
   Writes the data non blocking and returns a Future that can be consumed later. Its like the "overlapped" API for Windows. The Future returns the written bytes or throws an ExecutionException containig the cause SerialPortException

3. provide an additional method setWriteTimeout(long writeTimeoutMs) to set the 
Timeout that should be used for the next write operation.

Original comment by chriss....@gmail.com on 29 Oct 2012 at 12:22

GoogleCodeExporter commented 9 years ago
I also encountered this bug. I do not understand why have not decided yet.

Original comment by Demenkov...@gmail.com on 16 May 2014 at 11:00

GoogleCodeExporter commented 9 years ago
Hi,

I have an application which sends a reset command to an external device (via 
bluetooth). The next write is typically not possible since its not avaliable 
anymore. This causes my UI-Thread to hang infinitely. Is their anything I could 
help to get this fixed? its very urgent to me..

THX
-Marco

Original comment by marcomoe...@gmail.com on 28 Oct 2014 at 2:08

GoogleCodeExporter commented 9 years ago
hi,

your suggestion to close it from another thread is not working for me, so it 
would be really good to get this fixed. it crashed my whole application on 
windows.

THX!
-marco

Original comment by marcomoe...@gmail.com on 28 Oct 2014 at 2:48

GoogleCodeExporter commented 9 years ago
Hi,

anything new on this? I could ask for a reward if someone fixes this! 
Interested?

thx

-marco

Original comment by marcomoe...@gmail.com on 10 Feb 2015 at 8:42

GoogleCodeExporter commented 9 years ago
This issue bothered me for a few days. Hope it can be solved soon. 

Original comment by mzha...@gmail.com on 23 Apr 2015 at 9:10