Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8540909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:42:19+00:00 2026-06-11T11:42:19+00:00

Possible Duplicate: java.net.SocketException: Software caused connection abort: recv failed I’m trying to write a

  • 0

Possible Duplicate:
java.net.SocketException: Software caused connection abort: recv failed

I’m trying to write a client server pair where the connection is live all day and the client waits for the server to send a message. The steps are:

  1. Server opens port and listens for connection
  2. Client connects in and waits for data
  3. Some time later (maybe hours) the server sends data to the client
  4. Client processes data and returns it to the server
  5. Repeat steps 3 and 4

I can get steps 1-4 working, however if I try to repeat step 3 I get the error in the title.

This is my method on the client side:

private static void waitForInput(SSLSocket sslsocket) throws IOException {
        do {
            try {
                ObjectInputStream ois = new ObjectInputStream(sslsocket.getInputStream());
                ObjectOutputStream oos = new ObjectOutputStream(sslsocket.getOutputStream());

                Object o = (Object) (ois.readObject());
                // excluded code to process data     

                oos.flush();
                oos.writeObject(o);
                oos.reset();
            }
            catch(ClassNotFoundException e){
                System.err.println(e.getMessage());
            }
        } while ( true );
    }

The code fails on the 4th line, The first time around it blocks and waits until I get the next bit of data, but it doesn’t work twice. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:42:20+00:00Added an answer on June 11, 2026 at 11:42 am

    Connection abort IOException is thrown when you are waiting to read from a socket that has been closed at the other end, check to see your server side code , if you are not accidentally closing the socket.
    Also the server side code could be uploaded for deeper analysis, also try posting the stack trace, it will help analyzing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Java sockets - java.net.ConnectException: Connection refused: connect I've created a simple chat
Possible Duplicate: Java external program I am trying to wrtie a program to write
Possible Duplicate: Java float division precision I'm trying to fix a bug in one
Possible Duplicate: Is shifting bits faster than multiplying and dividing in Java? .NET? To
Possible Duplicate: Java GUI repaint() problem? I write a Java code, but I have
Possible Duplicate: Java Class.cast() vs. cast operator I am unsuccessfully trying to find out
Possible Duplicate: Java socket sends some data during connection to server I have two
Possible Duplicate: Why are Exceptions not Checked in .NET? Coming from Eclipse/Java, I noticed
Possible Duplicate: Why can't strings be mutable in Java and .NET? Why .NET String
Possible Duplicate: Java: Start Mail-Client with Attachment? I need to create a java code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.