Thread: calling multiple WSAStartup()

  1. #1
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104

    calling multiple WSAStartup()

    Hi.
    If i do something like this in my program:
    Code:
     WSAStartup(..);
     WSAStartup(..);
     WSAStartup(..);
     WSAStartup(..);

    Will this produce any errors, or bugs in my program? Or is it ok to call it multiple times, if i just wanna be 100% sure that winsock havnet been terminated at a speccial point in my program..

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    What does the documentation say?

    gg

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Each call to WSAStartup() increments an counter. So if you make multiple calls, make sure you keep count and do the same to WSACleanup().

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 06-08-2009, 03:03 PM
  2. Replies: 6
    Last Post: 01-09-2007, 04:12 PM
  3. Phantom redefinition
    By CodeMonkey in forum C++ Programming
    Replies: 6
    Last Post: 06-12-2005, 05:42 PM
  4. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 02:41 AM
  5. Calling multiple functions
    By martina in forum C Programming
    Replies: 8
    Last Post: 04-09-2003, 09:14 PM