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

Robert Temple robert.temple at dig.com
Fri Sep 22 13:53:48 CDT 2000


I do handle not getting a proper close.  I tell the user they've been
unexpectedly disconnected, etc, etc.

Its just that IMHO, if we are using XML, we should use correct XML.
Hopefully adding 1 line of code on the server side isn't too much to
ask for.

Plus, if the server always sent an </stream> I could interpret the lack
of an </stream> as a potential problem.

Robert

-----Original Message-----
From: Chris [mailto:cjbehm at mail.com]
Sent: Thursday, September 21, 2000 1:42 PM
To: jdev at jabber.org
Subject: Re: [JDEV] Re: Re: missing </stream:stream>


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


_______________________________________________
jdev mailing list
jdev at jabber.org
http://mailman.jabber.org/listinfo/jdev




More information about the JDev mailing list