Link to home
Start Free TrialLog in
Avatar of sanjaychopra
sanjaychopra

asked on

Timeout in UNIX

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.                                
ASKER CERTIFIED SOLUTION
Avatar of kamath
kamath

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial