Network stack refactor #735

pull sipa wants to merge 1 commits into bitcoin:master from sipa:netbase changing 21 files +1041 −546
  1. sipa commented at 9:35 pm on January 2, 2012: member

    This introduces CNetAddr and CService, respectively wrapping an (IPv6) address and an IP+port combination. This functionality used to be part of CAddress, which also contains network flags and connection attempt information. These extra fields are however not always necessary.

    These classes, along with logic for creating connections and doing name lookups, are moved to netbase.{h,cpp}, which does not depend on headers.h.

    Furthermore, CNetAddr is completely IPv6-ready, though IPv6 functionality is not yet enabled for the application itself.

  2. gavinandresen commented at 4:44 pm on January 3, 2012: contributor

    ACK, compiles and runs on my Mac.

    I’ll let somebody else comment on the API, network programming isn’t my thing.

  3. laanwj commented at 10:42 am on January 4, 2012: member
    Code changes OK, compiles and runs on Ubuntu 11.10.
  4. sipa commented at 12:41 pm on January 4, 2012: member
    Also compiles on ubuntu-mingw.
  5. sipa commented at 12:46 pm on January 4, 2012: member
    Forgot to mention: because name lookups happen using the unified getaddrinfo() call, a #define _WIN32_WINNT 0x501 was necessary, which means WIndows XP or later. Is it a problem to break compatibility with Windows 2000 and earlier (not even sure it still worked on those)?
  6. laanwj commented at 12:52 pm on January 4, 2012: member
    Yes, I noticed that, but it’s fine with me, no need to support >10yr old OSes
  7. TheBlueMatt commented at 0:48 am on January 5, 2012: member
    Bitcoin currently doesnt work on pre-WinXP (due to issues with the build of miniupnpc, which I still havent fixed, but I suppose if you are going to break it again, might as well not bother)…
  8. sipa commented at 11:49 pm on January 5, 2012: member
    @laanwj: by the way, does it work in the windows dev environment as well?
  9. jgarzik commented at 4:03 pm on January 6, 2012: contributor

    overall ACK

    Minor quibble, maybe ignore-able: The connection logic in CService feels like it belongs in a separate class. CService and CNetAddr seem more focused on address and/or endpoint datum, whereas the connect() logic seems more in the socket realm.

  10. sipa commented at 5:39 pm on January 6, 2012: member
    @jgarzik: I moved ConnectSocket out of CService.
  11. Network stack refactor
    This introduces CNetAddr and CService, respectively wrapping an
    (IPv6) IP address and an IP+port combination. This functionality used
    to be part of CAddress, which also contains network flags and
    connection attempt information. These extra fields are however not
    always necessary.
    
    These classes, along with logic for creating connections and doing
    name lookups, are moved to netbase.{h,cpp}, which does not depend on
    headers.h.
    
    Furthermore, CNetAddr is mostly IPv6-ready, though IPv6
    functionality is not yet enabled for the application itself.
    67a42f929b
  12. jgarzik commented at 7:02 pm on January 6, 2012: contributor
    visual ACK
  13. pstratem commented at 6:50 am on January 7, 2012: contributor
    I see nothing obviously wrong
  14. sipa referenced this in commit 1684f98b27 on Jan 7, 2012
  15. sipa merged this on Jan 7, 2012
  16. sipa closed this on Jan 7, 2012

  17. coblee referenced this in commit 623825668e on Jul 17, 2012
  18. destenson referenced this in commit 4249b28230 on Jun 26, 2016
  19. ptschip referenced this in commit fae22be82d on Aug 14, 2017
  20. sipa referenced this in commit ef7117193c on May 22, 2020
  21. sipa referenced this in commit 67f232b5d8 on Jun 9, 2020
  22. stackman27 referenced this in commit 78cde6f8c7 on Jun 26, 2020
  23. laanwj referenced this in commit 68d1f1698f on Sep 6, 2020
  24. 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: 2024-11-22 06:12 UTC

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