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,090 points
2,058 views

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,640 points
0 votes

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

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

Related Questions In Java

+1 vote
11 answers

How does java.net.SocketException: Connection reset happen ?

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

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

How to resolve the java.net.ConnectException in Java?

If you are getting java.net.ConnectionException, it means ...READ MORE

answered Jun 4, 2018 in Java by Akrati
• 3,150 points
534 views
0 votes
1 answer
+5 votes
3 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,400 points

edited Nov 6, 2018 by Omkar 21,011 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
106 views
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,370 points
145 views
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,890 points
2,704 views
0 votes
1 answer

What is a StackOverflow Error

Parameters and local variables are allocated on ...READ MORE

answered May 21, 2018 in Java by Parth
• 4,640 points
206 views
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,090 points
217 views
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
• 52,710 points
152 views