I'm seeing three different exceptions on the serial ports and am unsure what they exactly mean.

Can anyone provide details as to *why* each of these may be throw:
  * PortInUseException
  * SerialPortUnavailableException
  * RejectedExecutionException

I have seen each of the preceding exceptions while trying to open a serial port. The first two make the open fail, the third does not (though the open operation has not completely succeeded either -- no data flows on the port.)

There are two specific cases that I have seen, both while attempting to connect to a device that's temporarily unavailable (ie powered off):

1) My program opens the port, times out, closes it, waits, and tries again (proper behavior). This cycle continues fine for awhile (time varies) then a single PortInUseException is thrown. On the next, and every following, attempt a SerialPortUnavailableException is thrown. The SerialPortUnavailableException continues until my program is shut down and restarted -- then it immediately can open the port again.

2) Same situation, same timeout cycles, but for some reason a RejectedExecutionException is thrown. The "open" still returns true, but no data flows on the port. Eventually the attempt times out. One the next, and every following, attempt the RejectedExecutionException is thrown and the behavior does not change.

In both cases, turning on the far end device after the first exception has no affect. The port, once failed stays that way. Stopping and restarting our program has immediately cleared up the issue each and every time. Unfortunately, stopping & restarting our problem is not a viable solution.

I have seen timing changes have some effect. With a 5-second delay between connection attempts only 27 attempts succeeded (timed out) over a period of about 8 minutes before throwing the PortInUseException. Changing that delay to 20 seconds, over 220 attempts were made over a period of 6+ hours before the exception was thrown.

Any clues???????

Thanks in advance!!!

--
boB Gage
Software Engineer
Merge Healthcare


This message is a PRIVATE communication. This message and all
attachments are a private communication and may be confidential or
protected by privilege. If you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or use of the
information contained in or attached to this message is strictly
prohibited. Please notify the sender of the delivery error by replying
to this message, and then delete it from your system. Thank you.

Reply via email to