[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] TCP_WRITE [Raw]
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] TCP_WRITE [Raw] |
Date: |
Mon, 09 Nov 2009 07:34:44 +0100 |
> In other words, could memory still be required for data copy that is not
> checked by the tcp sndbuf queue space.
Yes. That's because tcp_sndbuf() tests against a counter variable that can be
configured to any size in lwipopts.h. However, the memory needed to enqueue a
segment can be configured in lwipopts.h, too. If these values don't match,
tcp_write() can return ERR_MEM although the sndbuf limit isn't reached yet.
> If so, is there a check to test for available mem to copy data?
That's hard: depending on whether you copy data or not, you need a PBUF_RAM or
PBUF_ROM pbuf. In addition to that, you need one struct tcp_seg. These come
from the corresponding memp pools, but there is no default way (aside from
looking at the stats, maybe) to know if tcp_write will fail or not.
However, this is just the way lwIP is designed: your application code just has
to cope with tcp_write failing, that's all :-)
Simon
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
RE: [lwip-users] TCP_WRITE_FLAG_MORE, Bill Auerbach, 2009/11/09