Francois Bouchard wrote:
The other thing that makes me slightly nervous is the use of
NETCONN_NOCOPY. How/when are you freeing inbuf?
I'm doing a netbuf_delete after each receive. Grosso modo:
inbuf = netconn_recv(conn);
if (no errors)
netconn_write()
else
netconn_close()
netbuf_delete(inbuf);
In that case, using the NETCONN_NOCOPY flag with netconn_write() is
wrong. With _NOCOPY, you have to make sure the data is *not changed*
until it is completely sent and acked by the remote side. Especially
regarding retransmission, this can be a long time. In contrast to that,
you *free* the data you passe with _NOCOPY right after executing the
write, which may mean it is not even sent, let alone acked.
I don't know if that's your problem, but you should not use _NOCOPY
there. In fact, there are very few scenarios where _NOCOPY can really be
used!
Simon
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users