Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!rutgers!njin!princeton!udel!boutell From: boutell@freezer.it.udel.edu (Tom Boutell) Newsgroups: comp.unix.questions Subject: Non- Blocking Input Message-ID: <37112@nigel.ee.udel.edu> Date: 23 Nov 90 20:40:11 GMT Sender: usenet@ee.udel.edu Organization: University of Delaware -- ACIT Sun Lab Lines: 23 Nntp-Posting-Host: toffee.it.udel.edu Hi, folks. I'm the author of The Broken Throne, a multiplayer internet game. My particular pain today is, I can't find a terribly portable way to check for input from the user. I know it's not a fully portable thing in any case, but is there a good source of multiple solutions for multiple machines that I can incorporate into my code with a judicious bunch of #ifdefs? For my own (SunOS) use, the code gets hold of the fd of stdin, then uses ioctl(I_PEEK) on that to determine whether there's a key available. Works like a charm but most folks can't do it. Is the nodelay() keyword available under *other people's* versions of Curses the most portable method around? One other question: usleep(xxx) sleeps for xxx microseconds under SunOS. Is there a more portable equivalent? I need a good way of giving about a tenth of a second back to the OS to avoid writing CPU- hungry code. (I'd prefer to use input signals, but I keep running into situations where I stop receiving signals because another came in as I handled the first. Very frustrating business.) -- THE TECHNOLOGY HOUSE: An idea whose time has come! My girlfriend is a pseudo- aardvark. She is quite insistent on this point. And remember- when all else fails- and no one else can help- boutell@freezer.it.udel.edu