Serial write timeout?
Posted on 2001-08-13
I am trying to send data through the serial port. I'm not having any problems with that, but how can I detect when something goes wrong while writing data to it?
Currently I am writing data to it one byte at a time. If, during a large transmission, I disconnect the serial cable, my program just hangs on the write command. Is there any way to set up a timeout period for the write operation?
I am just using the standard write command with a file descriptor.