|Subject:||Re: [lwip-users] Transfer Mibs of data over TCP|
|Date:||Mon, 3 Apr 2017 13:43:44 +0000|
Why not use the RAW API server that is in the contribution ?
I am not using it because am using my own modified code that was created before the current version.
As far as I know it works nicely and many are using it J
I have no problems accepting a large file 1MB… never had to accept a larger file but I do not think it makes
I think that if netbuf_next() fails you need to add some delay and try again.
I mean add vTaskDelay(10) or similar and try again.
When you transfer large amount of data you may get into cases that the network has some lag.
In that case your netbuf_next() call nay fail.
Doing something like this:
#define READ_ERROR_DELAY 10
#define READ_ERROR_TIMEOUT 500
err_t MyRead( params )
Int RetVal , TotalTimeOut = 0;
RetVal = netbuf_next();
If(RetVal == (-1))
vTaskDelay(READ_ERROR_DELAY / portTICK_RATE_MS);
TotalTimeOut += READ_ERROR_DELAY;
} while(TotalTimeOut < READ_ERROR_TIMEOUT);
The above function will try to read from the socket and if fails it will delay for about 10 ms… that way you give
the TCP and other system tasks time to run.
If the above is not an option due to system constrains you can adapt some kind of state machine, per connection
and use lwip own function sys_timeout to trigger for the above function or similar.
Hope that gives some ideas…
From: lwip-users [mailto:lwip-users-bounces+address@hidden
On Behalf Of Tóth Norbert
I have to receive files (20-40MB) via HTTP POST request and store them into SD card (basically it is a simple HTTP file server).
|[Prev in Thread]||Current Thread||[Next in Thread]|