Writing to Socket outputStream w/o closing it
Hi,
I'd like to write some messages to the server.
Each time, for the tramsmitting only, I'm closing the outputStream and reopen it when I have to send the next message.
Code:
os.write(msgBytes);
os.write("\r\n".getBytes());
os.flush();
os.close();
Is it possible to keep the outputStream, os, open and still able to send the message?
Thanks.
The problem has been solved
I have found it in the client's code.
I have read the data from server:
Code:
(count = inputStream.read(b) ) > -1
which hold the data till server socket closed.
This couses to the problem.