Connection reset java net SocketException

0 votes
Getting this error when trying to read from a socket. I'm doing a readInt() on that InputStream, and I am getting this error. Going through the documentation this suggests that the client part of the connection closed the connection. In this scenario, I am the server.

I have access to the client log files and it is not closing the connection, and also, its log files suggest I am closing the connection.

So does anybody have an idea why this is happening? What else to check for? Does this arise when there are local resources that are perhaps reaching thresholds?
May 30, 2018 in Java by Daisy
• 8,110 points

2 answers to this question.

0 votes

We had this problem with a SOA system written in Java. we were running both the client and the server on different machines and they worked fine for a long time, then those weird connection resets appeared in the client log and there was not anything strange in the server log. Restarting both client and server didn't solve the problem.

Finally, we discovered that the heap on the server side was rather full so we increased the memory available to the JVM: problem solved!

answered May 30, 2018 by Parth
• 4,630 points
0 votes

You should check whether the client program is finishing before server read the streams.

answered Sep 6, 2018 by Sushmita
• 6,900 points

Related Questions In Java

+1 vote
13 answers

How does Connection reset happen ?

You can use wireshark to view the ...READ MORE

answered Dec 7, 2018 in Java by tushh
0 votes
1 answer

How to resolve the in Java?

If you are getting, it means ...READ MORE

answered Jun 4, 2018 in Java by Akrati
• 3,170 points
0 votes
1 answer

how to read csv file form sftp connection and store into string object in java code and convert into it using rest api

Hey, @Pooja, Before starting with anything you should ...READ MORE

answered May 12, 2020 in Java by Roshni
• 10,480 points
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 6, 2018 by Omkar 48,274 views
+1 vote
2 answers

How to use try & catch block in Java?

Hey @Jino, Using try catch block for your ...READ MORE

answered Dec 21, 2018 in Java by Nabarupa
0 votes
1 answer

What is ArrayIndexOutOfBoundsException ?

If You check System.out.print(names.length); you will get 3 ...READ MORE

answered May 11, 2018 in Java by sharth
• 3,350 points
0 votes
2 answers

How can I solve java.lang.NoClassDefFoundError in Java?

NoClassDefFoundError means that the class is present ...READ MORE

answered Sep 11, 2018 in Java by Sushmita
• 6,900 points
0 votes
2 answers

What is a StackOverflow Error

stackoverflow error – StackOverflow Error in Java. This error is thrown to ...READ MORE

answered Aug 28, 2020 in Java by Pistle
• 1,000 points
0 votes
5 answers

How to compare Strings in Java?

String fooString1 = new String("foo"); String fooString2 = ...READ MORE

answered Jul 12, 2018 in Java by Daisy
• 8,110 points
0 votes
2 answers

How to round any number to n decimal places in Java?

new BigDecimal(String.valueOf(double)).setScale(yourScale, BigDecimal.ROUND_HALF_UP); will get you a BigDecimal. To ...READ MORE

answered Aug 26, 2019 in Java by Sirajul
• 59,070 points