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

  • SEARCH
  • Home
  • 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 8025027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:02:03+00:00 2026-06-04T23:02:03+00:00

I am making an application that accepts a TCP Socket connection and displays the

  • 0

I am making an application that accepts a TCP Socket connection and displays the info it sends. This works. I have decided though that i want to be able to send information multiple times from the client to the server. Right now this is how it sends.

socketStream = socket.getOutputStream();
to_send.add(new String[][] {{
ips + ":" + socket.getPort(),
System.getProperty("user.name"),
System.getProperty("os.name")
}});

sendData(to_send);

while(!finished) {
 socketStream = socket.getOutputStream();
 oos = new ObjectOutputStream(socketStream);
 oos.writeObject(new String[][] {{"Open","LOL"}});
 oos.flush();
}

–

public void sendData(ArrayList<String[][]> d) {
    try {

        oos = new ObjectOutputStream(socketStream);
        oos.writeObject(d);
        oos.flush();


        System.out.println("Sent: " + to_send.get(0));


    } catch (Exception e) {

        System.out.println(e.toString());
    }
}

I get this error:

java.net.SocketException: Software caused connection abort: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(Unknown Source)
    at java.net.SocketOutputStream.write(Unknown Source)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Unknown Source)
    at java.io.ObjectOutputStream.writeNonProxyDesc(Unknown Source)
    at java.io.ObjectOutputStream.writeClassDesc(Unknown Source)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.writeFatalException(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at Server.<init>(Server.java:57)
    at Server.main(Server.java:26)
  • 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-04T23:02:06+00:00Added an answer on June 4, 2026 at 11:02 pm

    Don’t close the socket in sendData. You will need to handle closing in code outside sendData.

    EDIT: This exception can be caused when the remote side terminates the connection. What is likely happening is that your use of two ObjectOutputStreams is causing an exception at the server, which is forcibly terminating the connection.

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

Sidebar

Related Questions

I'm making an application that recovers lottery numbers and displays them in a window.
I'm making a chat application that works with long-polling to emulate a push from
I'm making a web application using PHP in where I have a form that
I'm making an application that should be used in a store that displays product
So I am making an application that i want to populate a huge array,
i am making an application that reads sentences when clicking them, so i used
I am making an application that involves controlling Safari from Applescript. Is there a
I'm making an application that contains button's and those buttons control an embedded browser.
I'm making an application that is similar to Pages for iOS, in that it
I am making an application that I dont want it to close. So on

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.