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: Kieran Mansley
Subject: Re: [lwip-users] disconnect - connect delay
Date: Fri, 01 Apr 2011 10:27:17 +0100

On Fri, 2011-04-01 at 10:22 +0100, Kieran Mansley wrote:
> On Fri, 2011-04-01 at 11:13 +0200, brak brak2 wrote:
> > 
> > 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);
> 
> Close the listening socket once you've got one established.  Reopen it
> when you're ready to listen again.

Or even easier you could probably just leave the listening socket open
and set your accept callback to NULL until you're ready to handle the
next one.  e.g. in HTTP_connection_established call:

 tcp_accept(pcb, NULL)

where pcb is the listening PCB above, not the new connection's pcb.

Kieran 




reply via email to

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