| View previous topic :: View next topic |
| Author |
Message |
Eduardo Jauch Guest
|
Posted: Sat Feb 24, 2007 5:12 am Post subject: WSAStartup with threads |
|
|
I have a doubt...
If i have a program with the habilit to create various threads to
connect to a site via socket (same or different sites), I need to use
WSAStartup in every one of them or on the main program?
The help says that is possible to call them many times, since the
WSAClenup be called same number of times...
But my question is: It's necessary? Or on time (on the mais thread), is ok?
Thanks  |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sat Feb 24, 2007 6:42 am Post subject: Re: WSAStartup with threads |
|
|
"Eduardo Jauch" <eduardo.jauch (AT) gmail (DOT) com> wrote in message
news:45df74be (AT) newsgroups (DOT) borland.com...
| Quote: | If i have a program with the habilit to create various threads to
connect to a site via socket (same or different sites), I need to
use WSAStartup in every one of them or on the main program?
|
It doesn't really matter, as WinSock is reference counted. Calling
WSAStartup() and WSACleanup() in each thread will not hurt anything.
Only the first call to WSAStartup() and the last call to WSACleanup()
are important. The rest are just adjusting the reference count.
Gambit |
|
| Back to top |
|
 |
Eduardo Jauch Guest
|
Posted: Sat Feb 24, 2007 9:10 am Post subject: Re: WSAStartup with threads |
|
|
Remy Lebeau (TeamB) escreveu:
| Quote: | It doesn't really matter, as WinSock is reference counted. Calling
WSAStartup() and WSACleanup() in each thread will not hurt anything.
Only the first call to WSAStartup() and the last call to WSACleanup()
are important. The rest are just adjusting the reference count.
Gambit
|
Thanks  |
|
| Back to top |
|
 |
|