Writing Text to a Socket

try { BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())); wr.write("aString"); wr.flush(); } catch (IOException e) { }

Comments

13 Jan 2010 - 9:14pm by Agustín (not verified)

How can I send an excel file using a socket ???

23 Jan 2010 - 9:40am by Korion (not verified)

How to transfer File and image as jpg using Tcp socket if you please give some info will be excellent
thank you

4 Mar 2010 - 12:41am by Zohaib (not verified)

I am trying to communicate between a java server and a C client,
The problem is that my server is writing to the socket using DataOutputStream and i am not allowed to change that. So the C client is not able to properly read because it uses buffer.
I am using read(socket,buffer,strlen(buffer)) in C to read.

4 May 2010 - 4:52pm by Anonymous (not verified)

for what flush() is used? i can't catch.

24 May 2010 - 8:06am by Anonymous (not verified)

flush() lets the receiver know data is being sent i believe

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.