cancel
Showing results for 
Search instead for 
Did you mean: 

Connection reset by peer: socket write error

Former Member
0 Kudos

hi,

i get this error message when i use the out.write() command in my program after the loop is run one time. the second time it throws the Exception "Connection reset by peer: socket write error"

for(;;)
  {
  BufferedWriter out = null; 
  out=new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
  lesen=new BufferedReader(new InputStreamReader(System.in));
  t=lesen.readLine();
  out.write(t); 
  out.newLine(); 
  out.flush();
  out.close(); 
  }

thx and bye,

benjamin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Try to not to close the output stream .

You have to close it in the end of comunication

Former Member
0 Kudos

thx but if i start the program without out.close(), the error stays the same.