[JDEV] Re: Re: missing </stream:stream>
Chris
cjbehm at mail.com
Thu Sep 21 15:41:57 CDT 2000
on 09/21/2000 02:19 PM, Robert Temple at robert.temple at dig.com wrote:
> 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. 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. 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?
The _right_ thing for the client, though, is to properly handle the case
when it doesn't get a 'proper close'. So even if they do flush the data and
it does make it to you on the average case, you've still got to handle what
happens when it doesn't make it to you or there's some other reason that the
connection drops. I take it you can't hook the SAX parser up to a plain ol'
memory buffer to which you move data into? I can understand the appeal of a
SAX parser since it seems like a simple task of hooking it into the socket,
but if you can't handle out-of-the-ordinary stream traffic you might have an
issue.
Chris
More information about the JDev
mailing list