non-blocking scan or write?

bridged with qdn.public.qnxrtp.applications
Post Reply
Kevin Weisser

non-blocking scan or write?

Post by Kevin Weisser » Mon Jun 10, 2002 2:41 pm

I am writing a serial program that reads directly from the keyboard and
writes out to another computer I am almost completely done except I have a
blocking write in my program. I do a getchar then i check to see if it is
the exit key if it is i exit otherwise I do a write(). I was wondering if
there exists some kind of non blocking getchar or a way to see if get char
returned anything or if I need a non-blocking write(). Suggestions are
appreciated.

kweisser@udel.edu
Kevin

Thoma

Re: non-blocking scan or write?

Post by Thoma » Mon Jun 10, 2002 4:26 pm

Kevin Weisser <kweisser@udel.edu> wrote:
I am writing a serial program that reads directly from the keyboard and
writes out to another computer I am almost completely done except I have a
blocking write in my program. I do a getchar then i check to see if it is
the exit key if it is i exit otherwise I do a write(). I was wondering if
there exists some kind of non blocking getchar or a way to see if get char
returned anything or if I need a non-blocking write(). Suggestions are
appreciated.
Check out the select() function. You will find a pretty good example there
as well

regards,
Tom

Post Reply

Return to “qdn.public.qnxrtp.applications”