Yes if I set it to zero so it never times out, it never happens.. but then I 
have the crash when I try to write.  The same thing happened if I set it to 20 
seconds... but I can only find out about it if I disable the write... if I put 
the write in the read loop thread, then I have to have the timeout or I can 
never write without input.
It doesn't happen for EVERY timeout.. just occasionally.. I'm pretty sure it 
only happens if input happens to come in coincidentally with the between the 
time the timeout is issued and the time the read is actually stopped.  You 
would think the chances of the timeout happening to start just a few machine 
cycles before some data came in and completed the read would be unlikely.. but 
this seems to come quite often.    I can solve the timeout error by setting the 
timeout to 0 and only doing reads in the read loop... but I'll have to solve 
the crashing when writing while waiting for a read problem to do that.

I'm curious if there is a mode available where I can set it to 'always try to 
read data and jump to this procedure when there is some'  so I don't have to 
keep starting and stopping a read request...  kind of a request to read 
constantly?   Where I get things set up and everytime data comes in, my read 
thread gets activated and my variables populated... or maybe the best solution 
is to find out why it's crashing when I try to write while the wait for read is 
happening.

James

>Here is something you can try immediately. How about setting the timeout on 
>interrupt read to some ridiculously larger value, say 20 seconds to see if the 
>error happens less 
>frequently. Of course, when you close the program you may have to wait up to 
>20 seconds for the read thread to finish.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to