Understanding espconn_recv_hold

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Understanding espconn_recv_hold

Postby kolban » Tue Oct 27, 2015 10:44 pm

I am reading the 1.4 SDK programming guide and am trying to understand the API called "espconn_recv_hold".

Would it be possible to get a better explanation of what this API means and how it should be used?

My guesses are as follows:

Consider an ESP8266 that is receiving data over the network. Assume that it is receiving 10K/second but yet can only process 5K/second. Obviously the data is arriving faster than can be processed in real time. Since the way the ESP8266 SDK is designed is to invoke the receive callback when the data arrives, what this API does is suspend the invocation of the receive callback. So where then does the data go? My belief is that it is then buffered (throttled) at the transmitter implementing a flow control mechanism. However, I am not 100% convinced this is correct ... does anyone know?

Reading the docs, they say an interesting thing:

"The function does not act immediately; we recommend calling it while reserving 5*1460 bytes of memory."

What does that mean? What does "not act immediately" mean? Where should we be reserving 7300 bytes of memory and what is its purpose?

I have a guess that when we call "espconn_recv_hold" that there may already be in-flight data that has already been acknowledged that may be up to 7300 bytes in length ... is that correct?

Hoping we can all have a forum chat on this interesting function.

milesstone
Posts: 60
Joined: Mon Apr 26, 2021 4:50 pm

Re: Understanding espconn_recv_hold

Postby milesstone » Wed Nov 24, 2021 9:11 pm

kolban wrote:I am reading the 1.4 SDK programming guide and am trying to understand the API called "espconn_recv_hold".

Would it be possible to get a better explanation of what this API means and how it should be used?

My guesses are as follows:

Consider an ESP8266 that is receiving data over the network. Assume that it is receiving 10K/second but yet can only process 5K/second. Obviously the data is arriving faster than can be processed in real time. Since the way the ESP8266 SDK is designed is to invoke the receive callback when the data arrives, what this API does is suspend the invocation of the receive callback. So where then does the data go? My belief is that it is then buffered (throttled) at the transmitter implementing a flow control mechanism. However, I am not 100% convinced this is correct ... does anyone know?

Reading the docs, they say an interesting thing:

"The function does not act immediately; we recommend calling it while reserving 5*1460 bytes of memory."

What does that mean? What does "not act immediately" mean? Where should we be reserving 7300 bytes of memory and what is its purpose?

I have a guess that when we call "espconn_recv_hold" that there may already be in-flight data that has already been acknowledged that may be up to 7300 bytes in length ... is that correct?

Hoping we can all have a forum chat on this interesting GBWhatsApp Apk.

Just read the documentation: https://www.espressif.com/sites/default ... nce_en.pdf

Nielson
Posts: 55
Joined: Wed Dec 09, 2020 4:15 pm

Re: Understanding espconn_recv_hold

Postby Nielson » Thu Nov 25, 2021 9:42 pm

milesstone wrote:
kolban wrote:I am reading the 1.4 SDK programming guide and am trying to understand the API called "espconn_recv_hold".

Would it be possible to get a better explanation of what this API means and how it should be used?

My guesses are as follows:

Consider an ESP8266 that is receiving data over the network. Assume that it is receiving 10K/second but yet can only process 5K/second. Obviously the data is arriving faster than can be processed in real time. Since the way the ESP8266 SDK is designed is to invoke the receive callback when the data arrives, what this API does is suspend the invocation of the receive callback. So where then does the data go? My belief is that it is then buffered (throttled) at the transmitter implementing a flow control mechanism. However, I am not 100% convinced this is correct ... does anyone know?

Reading the docs, they say an interesting thing:

"The function does not act immediately; we recommend calling it while reserving 5*1460 bytes of memory."

What does that mean? What does "not act immediately" mean? Where should we be reserving 7300 bytes of memory and what is its purpose?

I have a guess that when we call "espconn_recv_hold" that there may already be in-flight data that has already been acknowledged that may be up to 7300 bytes in length ... is that correct?

Hoping we can all have a forum chat on this interesting GBWhatsApp Apk.

Just read the documentation: https://www.espressif.com/sites/default ... nce_en.pdf

it's really helpful to me thanks for sharing this link which help me a lot.

Who is online

Users browsing this forum: No registered users and 18 guests