[JDEV] Re: server2client

Thomas Charron tcharron at ductape.net
Mon Sep 20 12:29:20 CDT 1999


Quoting belg4mit at MIT.EDU:

> <message>
> 	<!-- crap -->
> </message>
> <message>
> 	<!-- other crap -->
> </message>
> The client has to know XML itself (or it's supporting lib) to know that
> that
> is two messages?

  Well, yea, pretty much.

> <!-- keep in the mind iscoming from a perl view -->

  Ahh, you need to learn the glory of XML::Parser.

> This would mean you'd have to read a single byte at a time to prevent
> getting
> extraneous data. (you could read more and do some funky stuff to save it of
> course) This seems to be a very uncool manner of doing things. Why wasn't a
> length attrib added to the message tag? the length being from the > at then
> end of the <message tag> to the > of the </message> tag. Yes I realize this
> mean's the whole message must be known before it can be streamed, but it
> seems
> a small price to play for sanity.

  If you coming from the perl point of view, you can pass an XML::Parser object 
data on the fly, with parse_more.  It handles tags as they come, including 
extra data from tags that are not yet finished.

> Or is the serve somehow smart enough to know to only feed the client one
> message a time? In which case this whole thing is moot.

  No, nor is this desired.  Messages can come in as fast as they want to.  The 
client has to be able to deal with the packets.  This is basic networking, 
really.



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




More information about the JDev mailing list