[jdom-interest] XML exchange by Socket connections

James Strachan james at metastuff.com
Tue Oct 24 06:33:31 PDT 2000

Why not try using HTTP and Servlets?
Failing that, you'll need to implement some protocol to denote when the XML
document ends if you want to keep the socket open. A simple way to do this
is to send the length of the text document first so the other end of the
socket can know when it has read all of the document.
James Strachan
email: james at metastuff.com <mailto:james at metastuff.com> 
web: http://www.metastuff.com <http://www.metastuff.com> 

----- Original Message ----- 
From: Otavio Rezende da Silva <mailto:otavio at teccomm.les.inf.puc-rio.br>  
To: jdom-interest at jdom.org <mailto:jdom-interest at jdom.org>  
Sent: Tuesday, October 24, 2000 1:11 PM
Subject: [jdom-interest] XML exchange by Socket connections

Hello all,
I'm building a Client-Server application which communicates using XML. To
make the exchange of XML files I'm doing Socket connections in Java. The
problem I am facing is that I can't build the dom tree by parsing the
received XML file using DOMBuilder.build( InputStream in ) before closing
the connection. This method blocks until the client's OutputStream is
closed. The problem ist that when the OutputStream is closed the same
happens to the connection, and I can't send the server response. I have
alredy tried to make an Adapter class tha calls flush instead of close (in
the client's side), but I didn't work. 
I don't know if any of you have already experienced the same problem, but I
would appreciate any kind of help.
Best Regards,
 Otavio Rezende da Silva 
 Grupo TecComm - PUC-Rio    
 Tel: (21) 540-6915 r 110                   

If you are not the addressee of this confidential e-mail and any
attachments, please delete it and inform the sender; unauthorised
redistribution or publication is prohibited. Views expressed are those of
the author and do not necessarily represent those of Citria Limited.

More information about the jdom-interest mailing list