mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Andrei A. Voropaev" <av@simcon-mt.com>
To: linux-kernel@vger.kernel.org
Subject: listen and backlog parameter - is it supposed to work?
Date: Wed, 16 Mar 2005 15:50:34 +0100	[thread overview]
Message-ID: <20050316145034.GA7811@vandal.simcon-mt.de> (raw)

Hello!

Recently I stumbled across interesting "feature" of listen and backlog
parameter for it. Stevens book mentions that this parameter shall
specify maximum count of ESTABLISHED connections that will wait in the
queue for accept to be picked up. It also says that for linux backlog =
0 in reality means that there'll be 3 ready connection waiting. The rest
of SYNs shall be dropped silently untill accept harvests the established
connection(s).

I've tried it with linux and sure enough it didn't work as described. In
fact, it works very strangely. In my test program I do listen(sock, 0)
and then go to sleep for long time. Then I try to connect to the port.
First 3 connections succeed as expected. The fourth one times-out (I
used time out 4 seconds), also as expected. But the fifth one again
succeeds. And all subsequent ones seemingly random succeed and time-out.
So in my test out of 30 connections I got between 10 and 20 connections
established.

It does not look like a proper behaviour, but maybe I'm missing
something? I'm using vanila kernel and I tried it both with 2.6 and 2.4.

Not that it's very important, but I'm really curious why is it so.

Thank you

Andrei Voropaev

PS. I'm not on the list

                 reply	other threads:[~2005-03-16 14:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050316145034.GA7811@vandal.simcon-mt.de \
    --to=av@simcon-mt.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®