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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:31:03+00:00 2026-05-27T09:31:03+00:00

Actually, the exception message just says Socket exception, but I went into the source

  • 0

Actually, the exception message just says “Socket exception”, but I went into the source code and saw “Couldn’t connect to 127.0.0.1” message. Any suggestions?

To clarify: I have roughly 10 to 20 connections being made per second every second, and exceptions are being thrown like twice per minute on average with unpredictable intervals and density. I fail to see any pattern.

P. S. I’m getting this exception both on Windows and Linux. GDB and QtCreator suck on Linux, however, so I only investigated it on Windows.

  • 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-05-27T09:31:03+00:00Added an answer on May 27, 2026 at 9:31 am

    10 to 20 connections being made per second every second, you say?

    You are almost certainly overflowing the “listen backlog” on the server. When a POSIX server program wants to listen for incoming socket connections, it calls listen() with a backlog argument, which is often roughly 5-100 or so. This sets the maximum number of incoming connections that the operating system will allow to be pending at the same time. So you can have more than 100 connections, but you cannot have 100 (or maybe even 10) in flight at once on the server. You can read about this here: http://www.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/023/2333/2333s2.html

    And indeed from the MongoDB bug tracker it appears that they use a default of 5. See here: https://jira.mongodb.org/browse/SERVER-2554 . On the other hand, the actual code on GitHub shows a backlog argument of 128: https://github.com/mongodb/mongo/blob/5a2f4ceb93b44283500f1ed346898439ca33b137/util/net/listen.cpp#L138 , and I went back 2.5 years and it seems like it had it as 128 then too. I’m not sure this is true, though–if it is, the Mongo people are not keeping their bug list up to date.

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

Sidebar

Related Questions

Question: Is exception handling in Java actually slow? Conventional wisdom, as well as a
I actually have two questions regarding exception/error handling in the iPhone app that I
I'm throwing an exception in my code. IE9 console reads Exception thrown and not
I know it is not good to just put a try catch with Exception
Here is code I use to POST into RESTful web service. My problem is
I was just working on fixing up exception handling in a .NET 2.0 app,
I have read other questions on this topic but none that actually answers my
I hate to just post a stack trace here, but I am out of
Youll need a 64bit machine if you want to see the actuall exception. I've
Actually, this question seems to have two parts: How to implement pattern matching? How

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.