I am converting several perl scripts to php and one of them does i/o to a serial tty port. This works very well if the other system is available. However, if the other system is offline then the process just hangs forever.
In perl this code was embedded within an eval { } block that has an alarm() function. If the alarm timer timesout the eval block is interrupted allows control to come back into the primary script and handled accordingly.
I haven't been able to find a similar feature to accomplish this in php. Can anyone please recommend if and how this might be done in php?
Thanks to all who can help.
Bob
In perl this code was embedded within an eval { } block that has an alarm() function. If the alarm timer timesout the eval block is interrupted allows control to come back into the primary script and handled accordingly.
I haven't been able to find a similar feature to accomplish this in php. Can anyone please recommend if and how this might be done in php?
Thanks to all who can help.
Bob