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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:30:46+00:00 2026-06-07T04:30:46+00:00

It was silly of me not to dump the stuck trace while catching the

  • 0

It was silly of me not to dump the stuck trace while catching the IOException from socket.accept() and shutting down the thread doing the accept… Having fixed this, I still want to understand how to deal with the situation when this call barfs.

My app is a classic socket server accepting hundreds of clients, sometimes thousands. Accepting thread is always up and blocked in accept() call. Once accepted, the separate thread gets launched to do the stuff and so on. Nothing special.

The question is, what should be done when accept() fails? Should this be considered as a permanent failure immediately? Should I retry to get into accept() for some time and try to get through? What’s the best practice? And what normally the reasons for the IOException to be thrown?

  • 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-07T04:30:49+00:00Added an answer on June 7, 2026 at 4:30 am
    1. Its the clients responsibility to retry on connection failure. The server should just log the exception and continue back doing “accept”. Servers in general, never initiate connections to client.
    2. There are too many reasons for IOException to be thrown, from firewall issues to file-handle-exhaustion issues. The message of the IOException should reveal the cause.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not particularly experienced with python, so may be doing something silly below. I
Did not upgrade anything, nothing should have changed, but I may have a silly
This may be a silly question, but I'm not all too experienced with iPhone
Quick and silly jQuery selector question. Why this does not work : jsFiddle demo
Apologies if this is a silly question, and I'm not even sure of the
Sorry if this question sounds a little silly, but I am not sure what
A rather silly Vim question, but I've something to do, and I'm not finding
Update 2: Long story short, I was being silly (and, in my defense, not
Sorry, I'm sure making a silly mistake, but did not work out. I'm compiling
I'm not sure that silly question, but I ask: So, if there is an

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.