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 31, 2018 in Java by Daisy
• 8,140 points
5,899 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 31, 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,920 points

Related Questions In Java

+2 votes
13 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
253,366 views
0 votes
0 answers

java.net.SocketException: Connection reset

I was having an error when I ...READ MORE

May 8, 2022 in Java by Kichu
• 19,040 points
1,025 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,190 points
2,275 views
0 votes
1 answer

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

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

answered May 13, 2020 in Java by Roshni
• 10,480 points
3,847 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
2,045 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
966 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,920 points
34,139 views
0 votes
2 answers

What is a StackOverflow Error

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

answered Aug 29, 2020 in Java by Pistle
• 1,000 points
2,174 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,140 points
2,576 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
• 59,230 points
1,727 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP