tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Bob.Capps () pscmail ! ps ! net
To: tru64-unix-managers
Subject: C prg:  peeking in stdin before getchar or timeout alarm
Date: Thu, 27 Mar 1997 18:36:00 +0000	[thread overview]
Message-ID: <96078609810691.tru64-unix-managers.marc@archive.invalid> (raw)

     We have a process which communicates to dialin terminals which is 
     expecting things to behave in an orderly fashion:  Connect, tell me 
     what you want to do, are you done, goodbye.  The trouble is, things 
     don't always behave over various local phone lines.  We constantly 
     "hang" our process while it waits for more input from the dialin 
     terminal.  Does anyone have any code fragments to provide either of 
     the following:
     
     1) a way to "peek" into stdin before we call getchar to see if there   
     is anything to get and timeout after a certain period of time.
     
     2) a way to set up a timer so that if we don't get out of getchar 
     before a certain period of time has elapsed, we exit out of the 
     program.
     
     Thanks!
     
     Bob Capps
     bob.capps@ps.net

                 reply	other threads:[~1997-03-27 18:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox