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();
//some code to create MimeMessage
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.