|
From: | Chen |
Subject: | Re: RE: Re: [lwip-users] Struggling to build a TCP echo server |
Date: | Thu, 05 Feb 2009 09:59:14 -0500 |
Chen,
When NO_SYS=1, there is a lot more to do than you had to prior just calling
tcp_tick(). I use the following code to update the lwIP timers. You can
call this every mS (or to be more efficient, every 250mS since that is the
LCD of the all of the modulus operands). I essence, this becomes your
tcp_tick for lwIP. For the rest of your program, I'd switch to the more
standard socket interface in lwIP. The Rabbit stack wasn't really socket
compatible as their naming might imply.
Bill
void lwipProcessTimers( void )
{
void ip_reass_tmr( void );
if( (lwip_mS % TCP_TMR_INTERVAL) == 0 ) tcp_tmr();
if( (lwip_mS % ARP_TMR_INTERVAL) == 0 ) etharp_tmr();
#if IP_REASSEMBLY
if( (lwip_mS % IP_TMR_INTERVAL) == 0 ) ip_reass_tmr();
#endif
#if LWIP_AUTOIP
if( (lwip_mS % AUTOIP_TMR_INTERVAL ) == 0 ) autoip_tmr();
#endif
#if LWIP_IGMP
if( (lwip_mS % IGMP_TMR_INTERVAL ) == 0 ) igmp_tmr();
#endif
#if LWIP_DHCP
if( (lwip_mS % DHCP_FINE_TIMER_MSECS ) == 0 ) dhcp_fine_tmr();
if( (lwip_mS % (DHCP_COARSE_TIMER_SECS*1000) ) == 0 )
dhcp_coarse_tmr();
#endif
#if LWIP_DNS
if( (lwip_mS % DNS_TMR_INTERVAL) == 0 ) dns_tmr();
#endif
}
[Prev in Thread] | Current Thread | [Next in Thread] |