[JDEV] Re: Re: missing </stream:stream>

Thomas Charron tcharron at ductape.net
Thu Sep 21 16:27:22 CDT 2000


Quoting Robert Temple <robert.temple at dig.com>:
> You have to attach an input source to a SAX parser.  And in this case, that
> input source is a socket using calls to recv.

  An input source can be something like a BufferedReader, attached to a local 
Output stream.  Then you read from the socket, and push to the output stream, 
which is read by the input stream.  (Ok, not as easy as all that sounds, but 
it's sound, at least from a Java perspective..)

> And when the SAX parser trys
> to get more data but more data isn't there yet, it blocks on recv.
> Therefore SAX parsing has to be in a separate thread.

  No, you just have to be able to tell if there's any data in there before you 
try to read.  If none, don't call revc.

> I could have it try
> to insert arbitrary data into the stream before it blocks with a select
> statement, but then I wouldn't be sure if the parser was in the middle of
> some tag, potentially messing up the parser even more.
> The _right_ thing to do would just be to have the server flush its output
> before it shutdown socket.  Server team: do you agree or disagree?

  Agreed there.  Perhaps, on sending the close of stream, it would *WAIT* 
untill the remote end also sent the very same data back?

--- 
Thomas Charron
<< Wanted: One decent sig >>
<< Preferably litle used  >>
<< and stored in garage.  ?>>




More information about the JDev mailing list