On Thu, Feb 03, 2011 at 05:33:07PM -0700, Todd Millecam wrote:
> 
> 2) If select is really being called over and over, what is the value of
> > data in the loop?  If it's the empty string, then the stream is trying
> > to tell you that it's reached EOF and needs to be closed.  You should
> > probably add:
> >    if not data:
> >        stream.close()
> > just after the line with stream.read().
> >
> I've tried closing the streams in various ways.  The problem is that this
> needs to be persistent and periodically re-read the inputs.  I can't re-open
> these streams after closing them.
> I've also used readline at other points as opposed to read since in this
> context I can neatly divide all the inputs of worth by newline characters.

When this infinite loop happens, what is the value of data?  Also, is
there any chance that read() is raising an exception that is being
caught somewhere?  Have you tried doing read with a specified buffer
size (e.g., stream.read(4096) or something).

-- 
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to