QNethernet and internal Webpage

Stanleyvc

Active member
Hello all,

I have a web page in Teensy 4.1 and am using CSS and Ajax. The webpage is quite large with a lot of data and I notice that way too much data is being sent and the buffer cannot handle the data.

Whole blocks of data are disappearing.

Now I put a "Delay(50)" in each piece of data so that the buffer can process the data better. In itself that goes well however I waste a lot of cpu time this way.

Is there no way to retrieve the amount of buffer space used to determine the delay time?

Or are there other ways to solve this?

Thanks in advance.
 
I’m not certain what your code looks like or what you’re doing, but does this link help?
How to write data to connections

Delays in order to send data aren’t necessary. Note that QNEthernet doesn’t send data immediately when writing data unless you use `flush()`. Under the covers, lwIP buffers TCP data to make the number of packets sent more efficient.

Also, without special handling, it’s possible for some data to be dropped if you don’t check the return values of the output functions. This is one of the reasons I added `writeFully()`, explained in the above link.
 
Last edited:
Hello Shawn,

First of all, thank you very much for your help.

I am now trying to do it out with "client.writeFully" I modified a piece of the programme for this, but when compiling I get the following error.

Knipsel1.PNG


What am I not doing right?

Thanks in advance.
 
The short answer is that C strings don’t work with the ‘+’ operator. If you could share your code, or even a small representative runnable snippet, I could better provide guidance.
 
Back
Top