]> Joshua Wise's Git repositories - netwatch.git/blobdiff - net/net.c
Be a little bit quieter, and consequentially be a lot bit faster.
[netwatch.git] / net / net.c
index 5d0c75b4ebb69d767bc73231711beafbc6845e26..e7bb80ab50f50c61b0dd9a8ebe9a4d557bd8d14d 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -30,6 +30,7 @@ void eth_poll()
        struct pbuf *p;
        struct eth_hdr *ethhdr;
        static int ticks = 0;
+       int i = 15;     /* Don't process more than 15 packets at a time; we don't want the host to get TOO badly slowed down... */
        
        if (!_nic)
                return;
@@ -44,7 +45,7 @@ void eth_poll()
                tcp_tmr();
        ticks++;
 
-       if ((p = _nic->recv(_nic)) != NULL)
+       while ((i--) && ((p = _nic->recv(_nic)) != NULL))
        {
 //             outputf("NIC: Packet: %d bytes", p->tot_len);
                        
This page took 0.022542 seconds and 4 git commands to generate.