MaX <[email protected]> wrote:

> I'm looking to the netconn interface and I don't completely understand the 
> semantic of the netconn_write.
> The signature of the function is:
> 
> err netcon_write(struct netcon * aNetcon, void* aData, size_t, aSize, u8_t 
> API_Flags);
> 
> With the NETCONN_NOCOPY flag, the data should remain unattached until it has 
> been transmitted. 
> Therefore, what mechanisms can I use to know when a sent buffer can be reused 
> in a safe way?

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).

Simon
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to