lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Fwd: Re: ERR_MEM after write [LwIP 1.4]


From: Sergio R. Caprile
Subject: Re: [lwip-users] Fwd: Re: ERR_MEM after write [LwIP 1.4]
Date: Fri, 9 Jun 2017 10:04:40 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

As you should have seen on the examples, or read on the docs, sys_check_timeouts() needs to be called as frequently as possible, because it drives all the timing of the stack. There are some threads on the list with some clues on how long can calls be delayed.

You are using TCP, and TCP has a sliding window, and retransmissions, and ACKs to send and to check. If you mess with TCP time base, you will get trouble, and that is what you did. Even though the stack is event driven, it still needs a time base (for example) to check when it is time to retransmit because an ACK didn't make it.

You should not let your application timing rule the network timing.
You can of course do your measurement just in time when a request arrives, but if you have some timed/periodic stuff going on, you either handle it with the poll callback or you have your own timing but decouple it from the net. E.g.: you measure every xx ms/s, you put the value in a variable. A request from the net reads that variable. Of course you need to account for concurrency if you write that variable with interrupts and your stack runs on the main loop (as it should, with no calls to API functions from within irq handlers).



reply via email to

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