BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WSAStartup with threads

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket)
View previous topic :: View next topic  
Author Message
Eduardo Jauch
Guest





PostPosted: Sat Feb 24, 2007 5:12 am    Post subject: WSAStartup with threads Reply with quote



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 Smile
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Feb 24, 2007 6:42 am    Post subject: Re: WSAStartup with threads Reply with quote



"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





PostPosted: Sat Feb 24, 2007 9:10 am    Post subject: Re: WSAStartup with threads Reply with quote



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 Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.