lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] netconn_write semantic with NETCONN_NOCOPY flag


From: Simon Goldschmidt
Subject: Re: [lwip-users] netconn_write semantic with NETCONN_NOCOPY flag
Date: Sat, 24 Sep 2011 10:32:44 +0200

MaX <address@hidden> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]