Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have this piece of code to read from a serial port
sysread(COM,$buf,1); unpack("C*",$buf);
but it seems to never time out if there is nothing to read. Is there a non-blocking system equivalent (that's to say, not using the SerialPort module) to the above code - one where I can control the timeout value?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: non-blocking reading
by grep (Monsignor) on Feb 06, 2002 at 05:57 UTC | |
|
Use select function or adjust flag bits of mode parameter to sysopen - Re: non-blocking reading
by metadoktor (Hermit) on Feb 06, 2002 at 05:48 UTC |