java program read serial port data unstable at linux

R

Raine Wang

Hi,

My application needs to communicate with one external device at
windows and linux. At windows, I use the package sun provided and run
stably. But when the same program( of course, there is different with
the device's name :) ) runs at linux(Redhat) using RxTx package, it
always can't get data from port. My program need to send a lot of
times quest to the device and read the response(data) from the serial
port after each request. This process will repeat hundred times. But
the program always can't fully executed. It sometimes will just stay
at the read sentence and wait for data( I am sure the data should be
arrived). When will the program blocked at the read sentence is not
fixed.
program sometimes is blocked at the first time, sometimes after read
several times, sometimes no block at all. But my program running at
windows don't have this kind of problem. :(

Please give me some ideas. Thanks in advance.

Raine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top