calling multiple WSAStartup()

This is a discussion on calling multiple WSAStartup() within the Networking/Device Communication forums, part of the General Programming Boards category; Hi. If i do something like this in my program: Code: WSAStartup(..); WSAStartup(..); WSAStartup(..); WSAStartup(..); Will this produce any errors, ...

  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,669
    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, 03: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21