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 8918057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:39:17+00:00 2026-06-15T05:39:17+00:00

Forgive me if this is simple, as I’m fairly new to server/client coding and

  • 0

Forgive me if this is simple, as I’m fairly new to server/client coding and am trying to teach myself.

I’ve made a server and client which work fine and interact perfectly while both are running. The problems I run in to are when I exit the application that contains the client. As soon as I do, I get an unending error saying:

null -- Connection reset
java.net.SocketInputStream.read(SocketInputStream.java:113)
java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
java.io.BufferedInputStream.read(BufferedInputStream.java:317)
sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
sun.nio.cs.StreamDecoder.read0(StreamDecoder.java:107)
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:93)
java.io.InputStreamReader.read(InputStreamReader.java:151)

Calling the close() method on the client’s reference to the socket doesn’t seem to have any effect on this whatsoever. I tried calling if(socket.isClosed()) from the server, but it says it’s still open even after the client has closed it.

How can I handle closing streams and sockets gracefully when my application exits?

  • 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-15T05:39:19+00:00Added an answer on June 15, 2026 at 5:39 am

    If at all possible, you can send some command that will tell your server application to close the connection.

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

Sidebar

Related Questions

I'm fairly new to Perl, so forgive me if this seems like a simple
Forgive me for this unbeautiful code, but I'm trying to get it to work
I'm new to ruby so forgive me if this is simple or I get
I'm pretty new to Javascript, so forgive me if this is a simple question.
I'm new to Ruby so forgive me if this is something obvious.. I've made
I'm new to web design, so please forgive if this is super simple- I've
This is probably a very simple problem but forgive me as I am new.
I am new to ASP.NET, so forgive me if this is simple. I am
I'm new to C#, so forgive this noobish question. I'm playing with a simple
I am new to WPF programming, so forgive me if this is a simple

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.