[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] TCP_LISTEN_BACKLOG setting problem

From: Mrutyunjay
Subject: Re: [lwip-users] TCP_LISTEN_BACKLOG setting problem
Date: Tue, 22 Feb 2011 18:29:53 +0530

hi ,
from comment in lwipopt.h is only a flag to enable backloging option  to tcp listening ports ,
not the count of listning as you are saying,
The count of listning queue should be controlled by the second parameter in the listen socket API,
/* Listen on Socket
     * Keep Server on listening mode
    if (listen(server_socket, MAXCLIENT) == -1)

 * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
#define TCP_LISTEN_BACKLOG          0     //Default = 0 == off

also the call flow follows to following net conn api
the comment says
 * Set a TCP netconn into listen mode
 * @param conn the tcp netconn to set to listen mode
 * @param backlog the listen backlog, only used if TCP_LISTEN_BACKLOG==1
 * @return ERR_OK if the netconn was set to listen (UDP and RAW netconns
 *         don't return any error (yet?))
netconn_listen_with_backlog(struct netconn *conn, u8_t backlog)

Mrutyunjay B Patel

On Tue, Feb 22, 2011 at 5:51 PM, Simon Goldschmidt <address@hidden> wrote:

Mrutyunjay <address@hidden> wrote:
> if i set TCP_LISTEN_BACKLOG 0  , I can see 1 active connection and 8 in
> queue , 9th connection is rejected.

Setting TCP_LISTEN_BACKLOG==0 means "disabled". In this case, backlog is limited by the number of PCBs.

> if i set TCP_LISTEN_BACKLOG 1  , I can see 1 active connection and 1 in
> queue.

In lwIP, the listen backlog is the number of incoming connections queued for accept(), meaning once you accepted one connection, another one is free to be queued for the next accept call. Open client connections previously accepted do not count in here.

GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl

lwip-users mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]