realbasic-nug
[Top] [All Lists]

Re: Nonblocking StdIn?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Nonblocking StdIn?
From: jon pipitone <jon dot pipitone at utoronto dot ca>
Date: Tue, 31 Jan 2006 19:13:02 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20060131220844 dot D19C110A6CAA at lists dot realsoftware dot com> <F5B672C8-2E9C-423C-9370-1C9B5012469C at elfdata dot com>
Hey Theodore,

Theodore H. Smith wrote:
I'm currently writing a console application and I'd like to be able to
get input from the user yet not have the application block if  there's no
input available.


Why shouldn't it block?

Ha! That made me smile. So yeah, I understand that there are other ways of doing things (threads, separate processes, yada yada), I was simply asking if there was a way I could use StdIn in a nonblocking fashion so that I didn't have to change much in the way my existing code is working.

But, FYI, my app is a TCP server of sorts and I was looking in to building a console version of it. Thus, without getting into threads and such, my main Run() loop must handle user input whilst also yielding to the main event loop of the application so that socket events can be fired. And so, this is why the question of a nonblocking stdin call came up.

It's no matter really, I was just curious because it seemed like quite different behaviour from other RB streams I've dealt with (and so I figured I might be overlooking something).

Take care,
jp
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>