Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/05/02 22:44
Read: times


 
#25357 - RE: cport problem
"In other words all free libraries are cheap kids toys.
I said earlier its excellent cport library but i guess because it was very easy to use."


Unfortunately, paying lots of money for a Library does not guarantee anything better :-(

We paid for the AsyncPro library from TurboPower and, I'm afraid to say, I have seen similar problems to yours - and many more! :-(
I regret the purchase.

I think this problem may be due to the asynchronous nature of these libraries - the actual COM port handler is running in a Thread of its own.
I suspect that your 'Open' for the new port may be arriving in the low-level Thread before it's actually finished the preceding 'Close' - and it gets its knickers in a twist.

I have found with AsyncPro that closing the Application often generates exceptions - even if I write an OnClose handler which explicitly closes the port(s).
Again, I think this is because the main Application has requested the port(s) to close, but it takes a while for the low-level Thread to get around to actually closing them - meanwhile, the Main Application has terminated while data is still coming in from the not-yet-closed port(s)! :-(

I have just tried putting a delay (~2s) after closing the port(s) before allowing the main Application to really close - this seems to be working better.

Perhaps you could try a similar delay between your 'Close' and the subsequent 'Open' for the new port?

List of 11 messages in thread
TopicAuthorDate
cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      
RE: cport problem            01/01/70 00:00      

Back to Subject List