XML Client Server using Transformer

Hi all,

I am trying to write a Client Server application that performs message exchange using XML.

I have written a small test program that uses javax.xml.transform.Transformer.transform method to send and receive DOM Documents over Socket.

The problem is I don't know how to terminate the XML sending properly. So after I call the `transform` method on the client, it seems like the server never stopped reading.

My question is, is there a standardised way of sending some sort of end of file character so that the server knows to stop receiving? I've tried sending -1, but it just chcks out lots of Exception.

Also, what is the best InputStream, OutputStream combination to use with Transformer.transform method? DataInput/OutputStream, BuffereReader/Writer?

Finally, what is the best way to send XML over Socket?

BTW I want to use just one Socket. I know closing the Socket will send a end of stream to the server, but then I'll have to create and close Socket everytime I want to send something, and that's no good for me.

Thanks.

[1093 byte] By [honhwanga] at [2007-11-27 0:50:36]
# 1
see these page " http://www.dagblastit.com/java/sockets.html" i build a Java to Flash Server socket using this tutorial... observe that the XML messages has a end delimiter byte 0...
maximilian.brasila at 2007-7-11 23:20:48 > top of Java-index,Core,Core APIs...