lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_output doesn't flush


From: Thiscord
Subject: Re: [lwip-users] tcp_output doesn't flush
Date: Fri, 9 Jan 2015 15:03:42 -0700 (MST)

Simon Goldschmidt wrote
> That can't work: input processing is not called from your while(1) loop 
> and tcp_write/tcp_output thus still racing with input processing (e.g. 
> TCP ACKs).

I'm not sure I understand this. Isn't input processing ballback-based?


Simon Goldschmidt wrote
>>   just to keep the pcb variable valid. 
> 
> I'm not sure I understand this... 

Like so:
void server_init(void)
{
        struct tcp_pcb *pcb; //this needs to stay valid. That's why we keep that
infinite loop
        pcb = tcp_new();
        tcp_bind(pcb, IP_ADDR_ANY, 40001);
        pcb = tcp_listen(pcb);
        tcp_accept(pcb, server_accept);
        vTaskPrioritySet( NULL, tskIDLE_PRIORITY );
        while (1){}

}

When sending I use a pointer to the pcb that I gained from a
"server_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)"
callback (I save a pointer to it).



--
View this message in context: 
http://lwip.100.n7.nabble.com/tcp-output-doesn-t-flush-tp23660p23665.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

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