Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!ogicse!blake!wiml From: wiml@blake.acs.washington.edu (William Lewis) Newsgroups: comp.unix.questions Subject: Sockets & SIGIO, under Dynix (Sequent) ... or 4.3BSD Message-ID: <6381@blake.acs.washington.edu> Date: 25 Mar 90 01:55:03 GMT Reply-To: wiml@blake.acs.washington.edu (William Lewis) Organization: Clones `R' Us Lines: 27 I am writing a program that has to process both keyboard input (in CBREAK mode) and socket transactions. Much of the time it would be sitting idle, though, so I wrote the program as a loop: for(;;) { sigpause(0); if( ) { process keyboard data; } if( ) { process socket data; } }; This works beautifully for the tty input, but it won't wake up when things arrive on the socket. I have to press a key to get it out of the sigpause(), after which it processes the keyboard and socket info correctly. After RTFMing several times, I found a note to the effect that fcntl(FASYNC | FNDELAY) to produce a SIGIO only works on ttys, not on sockets. My question is, is there any way to produce a similar effect on a socket, or do I have to resort to polling the socket several times a second to be responsive? Any help would be appreciated. Thanks. -- JESUS SAVES | wiml@blake.acs.washington.edu Seattle, Washington but Clones 'R' Us makes backups! | 47 41' 15" N 122 42' 58" W