lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] disconnect - connect delay


From: brak brak2
Subject: Re: [lwip-users] disconnect - connect delay
Date: Fri, 1 Apr 2011 11:13:33 +0200

> I think you'd be better limiting the number of connections by modifying
> the webserver to only accept one at a time rather than trying to enforce
> this at the TCP level.
>
> Kieran
>

But how can I do this? I init TCP like this:

        pcb = tcp_new();
        err = tcp_bind(pcb, IP_ADDR_ANY, 80);//PORT HTTP
        pcb = tcp_listen_with_backlog(pcb, 1);
        tcp_accept(pcb, HTTP_connection_established);

When I allow 2 connections I have to reject second one in
HTTP_connection_established:

static err_t HTTP_connection_established(void *arg, struct tcp_pcb
*pcb, err_t err)
{
        if (HTTPActiveConn)
        {
                _error("abort");
                tcp_abort(pcb);
                return ERR_OK;
        }
....
}

This causes Abort state in browser for some of elements - they just don't load.
I don't want to handle simultaneous connections.

Tomasz



reply via email to

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