limited size of fd_set hangs new connections. #610

issue SergeiPavlov opened this issue on November 6, 2011
  1. SergeiPavlov commented at 10:38 PM on November 6, 2011: none

    In the file net.cpp function ThreadSocketHandler2() has following lines:

            BOOST_FOREACH(CNode* pnode, vNodes)
            {
                 ...
                FD_SET(pnode->hSocket, &fdsetRecv);
                  ...
            }
    

    but fdsetRecv size limited (64 items in Windows). So when we have more than 64 connections new connections are successfully accepted, but packets cannot be received from them. I have tested this situation and confirm:

    other peer sends "version" message but the current client dont reply on it if number of connections > 64

  2. gavinandresen commented at 3:15 PM on November 8, 2011: contributor

    Suggested fix: maxconnections should be set to less-than-64 on Windows.

    Long-term fix: use boost::asio for the networking stuff.

  3. sipa commented at 11:32 PM on April 23, 2013: member

    Closing as duplicate of #2408 (this one is much older, but the newer one has a better suggestion for a fix).

  4. sipa closed this on Apr 23, 2013

  5. kallewoof referenced this in commit 1ccb0b67f9 on Oct 4, 2019
  6. KolbyML referenced this in commit bc86927231 on Sep 4, 2020
  7. rajarshimaitra referenced this in commit 27b5100be4 on Aug 5, 2021
  8. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me