lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Is netconn_write blocking or not


From: Dimax
Subject: Re: [lwip-users] Is netconn_write blocking or not
Date: Thu, 3 Apr 2014 14:25:42 +0300

HI,
Some time ago I have asked a question below 

It is not clear from the API documentation if netconn_write function is blocking or not?

Did not actually get an answer but looking inside the code I got to the understanding that it is not blocking function if there are enough resources to send data.

But my problem is as following. I want to use netconn_write with NETCONN_NOCOPY flag. This requires fro the data to be stable during transmission. But I can't know for sure when transmission ends and the buffer can be used again. I need to implement something like that:

fill_buffer( buf, DATA_0, sz );
netconn_write( netconn, buf, sz, NETCONN_NOCOPY );
BLOCK_WAITING_FOR_COMPLETION
fill_buffer( buf, DATA_1, sz );
netconn_write( netconn, buf, sz, NETCONN_NOCOPY );
BLOCK_WAITING_FOR_COMPLETION
and so on.

How the "BLOCK_WAITING_FOR_COMPLETION" can be implemented? Without it a sequence shown about sends two buffers with DATA_1 both as DATA_0 buffer is overridden with DATA_1 before it got sent.
 

reply via email to

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