lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Transfer Mibs of data over TCP


From: Noam Weissman
Subject: Re: [lwip-users] Transfer Mibs of data over TCP
Date: Mon, 3 Apr 2017 21:38:34 +0000

Hy Sylvain,


WTF ???????????????


Sorry I meant netconn_recv etc...


Anyway that was rude of you so good luck 😊


Noam.




From: lwip-users <lwip-users-bounces+address@hidden> on behalf of Sylvain Rochet <address@hidden>
Sent: Tuesday, April 4, 2017 12:30 AM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Transfer Mibs of data over TCP
 
Hi,

On Mon, Apr 03, 2017 at 01:43:44PM +0000, Noam Weissman wrote:
> Hi,
>
> 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 ☺
>
> I have no problems accepting a large file 1MB… never had to accept a larger file but I  do not think it makes
> any difference.
>
> 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;
>
>    Do
>    {
>       RetVal = netbuf_next();
>
>       If(RetVal == (-1))
>       {
>           vTaskDelay(READ_ERROR_DELAY / portTICK_RATE_MS);
>           TotalTimeOut += READ_ERROR_DELAY;
>       }
>       else
>       {
>           break;
>       }
>
>    } 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…

WTF. Did you even read what the netbuf_next() function actually does ?

Sylvain

reply via email to

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