Re: what does 'backlog' parameter to listen do?

From: Konstantin Sorokin (spamtrap_at_pluto.sectorb.msk.ru)
Date: 07/20/04


Date: Tue, 20 Jul 2004 09:39:29 +0000 (UTC)

Michael Kerrisk <michael.kerrisk.at.gmx.net@nospam.com> wrote:
> On Mon, 19 Jul 2004 19:53:44 +0000 (UTC), Konstantin Sorokin
> <spamtrap@pluto.sectorb.msk.ru> wrote:
>
>>Andrei Voropaev <avorop@mail.ru> wrote:
>>> Hi!
>>>
>>> According to man 2 listen "The backlog parameter defines the maximum
>>> length the queue of pending connections may grow to." But in practice
>>> this parameter seems to mean nothing. At least when I call listen(s, 1)
>>> there still can be hundreds of connections established even though I
>>> didn't call accept for any. Is it because I have syn-cookies enabled? Or
>>> I just misunderstand the man page?
>>>
>>
>>Do you mean ESTABLISHED state from netstat output ? If so then you are
>>wrong, connections can't be in ESTABLISHED state until you call accept(2).
>
> This is wrong. An accept() does not need to be performed in order for
> TCP's three-way handshake to complete (and the two end-points to enter
> the ESTABLISHED state). Try it and see.

Yes, you are right. I've checked this on freebsd box. Thanks for
correction.

-- 
Konstantin Sorokin


Relevant Pages

  • Re: what does backlog parameter to listen do?
    ... On 2004-07-20, Michael Kerrisk wrote: ... >>Do you mean ESTABLISHED state from netstat output? ... connections can't be in ESTABLISHED state until you call accept. ... parameter to 1 and then don't call accept, just put it into sleep. ...
    (comp.os.linux.development.apps)
  • /proc/net/tcp information drop
    ... the process name and the pid itself gets lost, ... My own network-monitoring tool uses netstat to get some information about ... Here's a link to the netstat output ... meaning/ just shows unresolved/new connections) ...
    (Linux-Kernel)