On 24 Sep 2011, at 09:32, Simon Goldschmidt wrote: > TCP has to keep data buffer for retransmission until it is ACKed by the > remote host. There'd ere, it needs to maintain unchanged for a while. You can > either pass *static* data to netconn_write (NOCOPY), or tell netconn_write to > copy data into internal buffers. However, this means extra memcpy plus extra > buffer allocation (up to the amount of the TCP window).
So, just to avoid any room for confusion, this means you can't re-use and modify a buffer sent using netconn_write() as there isn't a way to find out when it is safe to do so. If you application-level protocol lets you deduce this (e.g. if you receive a response to the query you sent using netconn_write() then you can be sure that the query's buffer has now been transmitted successfully) you could probably then modify the original buffer, but I would avoid that if possible and stick to either "static data with NOCOPY" or "dynamic data with COPY" unless you're sure you know you can safely break this rule without causing problems. Kieran _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
