WSAStartup only called in BindListenPort #2585

issue laanwj opened this issue on April 27, 2013
  1. laanwj commented at 2:52 PM on April 27, 2013: member

    From what I understood, WSAStartup should be called on windows before using any of the other socket functions. According to http://msdn.microsoft.com/en-us/library/windows/desktop/ms742213%28v=vs.85%29.aspx :

    The WSAStartup function must be the first Windows Sockets function called by an application or DLL.
    

    However, it is called in BindListenPort which is only called (from init) when fNoListen is not set.

    Can a windows dev (@diapolo?) comment on this? Should we move the WSAStartup call some place else?

  2. Diapolo commented at 3:49 PM on April 27, 2013: none

    I can only comment on what I read and you are right. IMHO we should move the WSAStartup call before if (!fNoListen) { in init.cpp to be sure it got called. A little weird that this didn't yet cause more problems though...

    Edit: Also the wsadata attributes could be used for adding some debugging information to the log (iMaxSockets for example)?

  3. laanwj commented at 4:01 PM on April 27, 2013: member

    A wild guess is that qt or some other library that we use initializes it. Or it somehow works in an uninitialized state but that'd be a scary idea...

  4. sipa commented at 8:36 PM on April 27, 2013: member

    IMHO this should move to init.cpp

  5. laanwj referenced this in commit d23fa49c52 on Apr 28, 2013
  6. laanwj closed this on Apr 28, 2013

  7. kyledrake referenced this in commit 75d6000db6 on Jul 25, 2013
  8. laudney referenced this in commit 666f7cf021 on Mar 19, 2014
  9. 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-13 15:16 UTC

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