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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:26:29+00:00 2026-06-04T17:26:29+00:00

As I understand, backlog determines the size of the connection queue . Any extra

  • 0

As I understand, backlog determines the size of the connection queue. Any extra requests greater this size at that time will be dropped off(is this statment right??).

Now I have very simple program server.c

socket()
bind()
listen(..., 5)
while(1)
{
  accept()
  read()
  write()
  sleep(3)
  close()
}

Now, I start 8 clients at a time to connect to this server. Surprisingly, the server serves all the 8 clients but instead it should queue only 5 clients & remaining 3 clients requests should be refused. Another interesting point is even if I put this backlog value as 0, the result is still same. Then I tried commenting listen() call, with this all 8 clients connections get refused.

Can somebody provide any inputs on this.

  • 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-04T17:26:32+00:00Added an answer on June 4, 2026 at 5:26 pm

    The backlog argument is a hint about the size of the queue. So you can’t count on it to do what you are asking.

    listen()

    This answer seems to cover it.

    And more information, a quote from the listen(2) man page on my Ubuntu system:

    The backlog argument defines the maximum length to which the queue of pending connections for sockfd may grow. If a connection request arrives when the queue is full,
    the client may receive an error with an indication of ECONNREFUSED or, if the underlying protocol supports retransmission, the request may be ignored so that a later
    reattempt at connection succeeds.

    Note that it says “may” everywhere.

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

Sidebar

Related Questions

Understand that 1x1 widget size should be 72 dip x 72 dip, but this
I understand that this a very noob problem, but when I try to create
I understand that this may not necessarily apply to just @properties, but they would
I understand that the standard says that the size of a long integer is
I understand that this is a bad idea for lots of scenarios. I am
I understand that SimpleXML is far more efficient than DOMDocument. Any advice on how
I understand that a class will have a VTABLE , if it contains at-least
I understand that the answer to this question may depend on registry settings and
I understand that according to this issue ticket on google code http://code.google.com/p/fullcalendar/issues/detail?id=143 that there
I understand that every time I type the string literal , the same String

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.