C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 03-16-2005, 09:08 AM   #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..
__________________
http://livebad.com/nuka
Da-Nuka
Da-Nuka is offline   Reply With Quote
Old 03-16-2005, 09:42 AM   #2
Registered User
 
Codeplug's Avatar
 
Join Date: Mar 2003
Posts: 3,903
What does the documentation say?

gg
Codeplug is offline   Reply With Quote
Old 03-16-2005, 09:45 AM   #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
kuphryn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple inheritance: casting yields different address dwks C++ Programming 16 06-08-2009 03:03 PM
Multiple threads calling the same function at the same time Niara C++ Programming 6 01-09-2007 04:12 PM
Phantom redefinition CodeMonkey C++ Programming 6 06-12-2005 05:42 PM
Linker errors - Multiple Source files nkhambal C Programming 3 04-24-2005 02:41 AM
Calling multiple functions martina C Programming 8 04-09-2003 09:14 PM


All times are GMT -6. The time now is 04:02 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

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