views:

13

answers:

0

Hi, all. I'm using the javax communication API to connect the serial port, and I can send and receive data with it. But there's a problem, when the main method is over, the program is still running. I tried debug mode and found that when executed "SerialPort.addEventListener(); notifyOnDataAvailable(true);", a Win32SerialPort Notification thread would be established. And it keeps running when the main thread is over. I tried to use removeEventListener(), but it doesn't work. I can't bring the program to an end completely since I can't kill the thread. What should I do? Thanks.

Kevin