Timeout in UNIX
Posted on 1998-09-29
How do you implement a timeout in Unix???
Let me explain what I am trying to do:
I've opened a device file (serial port - connected to a modem) for I/O. I am communicating with a terminal (phone) which also has a modem. I need to wait for a response from the terminal after having sent a command. So I do a 'write' to the device file to send the command to the terminal, and do a 'read' from the device to get the response. I want to wait, let us say, only 15 seconds for the response, HOW DO I DO IT?
I am using the standard 'read' and 'write' routines.