On Fri, 2006-06-16 at 15:15 +0300, Pavel Grishin wrote:
> Hello,
>
> I am running a test program which sends some text continuously.
>
> while(1){
> do{
> while(tcp_sndbuf(serv_pcb) < strlen(text));
> err = tcp_write(serv_pcb, text, strlen(text), 0);
> tcp_output(serv_pcb);
> }while(err != ERR_OK);
> }
>
> It transmits a number of times and then stops with err = ERR_MEM.
> Why does it happen?
Probably because you're sending data faster than the other end is
acknowledging it, so your sender starts to fill its TCP send buffer,
using packet buffers in the process. After a while, you'll run out of
packet buffers, and it will return ERR_MEM. This is the cue to back off
and try again later.
Kieran
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users