We help IT Professionals succeed at work.

Urgent ! Clear Com Buffer, interrupt write

Andi4553
Andi4553 asked
on
How can i clear the Com Buffer ?

i am using import javax.comm.*; with RTS, CTS Flow Controll.

I send some data with

                              System.out.println(StatusTxt+"> Sending "+count+" Data");
                              spout.write(ethBuf, 0, count);
                              System.out.println(StatusTxt+"> Sending "+count+" Data Finished");

if no device is attached (no CTS, RTS activity) it hangs on the write.
How can i interrupt this ?
the write is in an extra thread, from the main thread i would like to interrupt the write.
Comment
Watch Question

Ovi

Commented:

Author

Commented:
dont know what you mean.
Ovi

Commented:
Thread.interrupt or Thread.stop (deprecated)
Ovi

Commented:
Sorry, They(experts page) have some problems I believe.

Author

Commented:
I don't want to interrupt the Thread i want to interrupt the write event.
Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
I don't think you can interrupt it.
Try setting a timeout on the write.

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for objects

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.