serializing MimeMessage

Hi ,

I would like to send the MimeMessage object via socket connection. To do do that i have written the following code fragment

Socket s = new Socket("localhost",3200);

OutputStream os = s.getOutputStream();

MimeMessage mimemessage

//

//some code to create MimeMessage

//

mimemessage.writeTo(os);

os.close() // this is important step

In this code fragment if i didnt close the output stream the message is not being delivered to the server side. But when i close the output stream it is closing the socket connection with the stream connection.

What i neeed is i will be sending mimemessage objects via socke asynchronously. For that purpose i would like to keep the outputstream of the socket keep opent always. But how can i send the mimemessage object via socket without closing the stream.

Please help me.

thanks in advance,

Sridhar reddy .R

[937 byte] By [sridhar_ratnaa] at [2007-9-29 22:45:51]
# 1
os.flush()
dpza at 2007-7-16 3:08:50 > top of Java-index,Archived Forums,Portability & Platform Independence [Archive]...
# 2
I tried that one also, but no hope.
sridhar_ratnaa at 2007-7-16 3:08:50 > top of Java-index,Archived Forums,Portability & Platform Independence [Archive]...