lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] calling arp_tmr() from tcp_slowtmr()


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] calling arp_tmr() from tcp_slowtmr()
Date: Thu, 09 Jan 2003 00:43:16 -0000

Hi!

On Wednesday 01 May 2002 01.09, Chris Borrelli wrote:
> I do not want to use the sys_timeout() function at all if possible.  I
> would like to remove the scheduled call to arp_timer in ethernetif.c,
> and just call the arp_tmr() from tcp_slowtmr() every 20 tcp_ticks.
>
> Does anyone have any comments/suggestions..
>
> Here is what I am adding to tcp_slowtmr().  I'll have to put ifdefs
> around it later...

Doing it this way is a perfectly good solution. I wouldn't have done it 
exactly like this, though. I would have put an extra layer of code around the 
timers, something like this:

void timer(void) {
  if(timer & 1) {
    tcp_fasttmr();
  }
  if(timer == 0 || timer == 5) {
    tcp_slowtmr();
    if (tcp_ticks %20 == 0) {
        arp_tmr();
    }
  }
}

This way, the ARP and TCP code wouldn't be intertwined, but kept separately.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam

[This message was sent through the lwip discussion list.]




reply via email to

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