mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Minor timer changes (~21 Mb/s local)
This commit is contained in:
parent
1bc33ae8d7
commit
bbfc9359e9
4 changed files with 15 additions and 8 deletions
|
@ -307,7 +307,7 @@ void NetconEthernetTap::closeAll()
|
|||
closeConnection(tcp_connections.front());
|
||||
}
|
||||
|
||||
#define ZT_LWIP_TCP_TIMER_INTERVAL 5
|
||||
#define ZT_LWIP_TCP_TIMER_INTERVAL 1
|
||||
|
||||
void NetconEthernetTap::threadMain()
|
||||
throw()
|
||||
|
@ -344,6 +344,7 @@ void NetconEthernetTap::threadMain()
|
|||
if (since_tcp >= ZT_LWIP_TCP_TIMER_INTERVAL) {
|
||||
prev_tcp_time = now;
|
||||
lwipstack->tcp_tmr();
|
||||
//fprintf(stderr, "tcp_tmr\n");
|
||||
} else {
|
||||
tcp_remaining = ZT_LWIP_TCP_TIMER_INTERVAL - since_tcp;
|
||||
}
|
||||
|
@ -353,6 +354,7 @@ void NetconEthernetTap::threadMain()
|
|||
} else {
|
||||
etharp_remaining = ARP_TMR_INTERVAL - since_etharp;
|
||||
}
|
||||
//fprintf(stderr, "poll_wait_time = %d\n", (unsigned long)std::min(tcp_remaining,etharp_remaining));
|
||||
_phy.poll((unsigned long)std::min(tcp_remaining,etharp_remaining));
|
||||
}
|
||||
closeAll();
|
||||
|
@ -399,6 +401,7 @@ void NetconEthernetTap::phyOnFileDescriptorActivity(PhySocket *sock,void **uptr,
|
|||
now space on the buffer */
|
||||
if(sndbuf == 0) {
|
||||
_phy.setNotifyReadable(sock, false);
|
||||
lwipstack->_tcp_output(conn->pcb);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue