[jdom-interest] reading xml from a socket

Jef Dodson jcdodson at hotmail.com
Mon May 14 18:22:52 PDT 2001

I want to write some code that reads xml from a tcp/ip socket.  The problem 
is, what if the application on the other end of the socket writes more than 
one document to the socket's outputstream before my application reads the 
document from the inputstream?  Will the build() method be smart enough to 
build each document separately, or will it throw an exception because it 
looks like the document is not well formed?  For example, suppose a client 
sends two messages to a server in rapid succession before the server app. 
reads the data from the socket, so that the xml looks like the following to 
the server:

<message id="1">
    <body>Hello World</body>
<message id="2">
    <body>Hello again</body>

Now, what happens when the builder.build() method is called?



Get your FREE download of MSN Explorer at http://explorer.msn.com

More information about the jdom-interest mailing list