WSAStartup()?

May 20, 2008
12,165
133
Syracuse, NY, USA
Do plugins need to call WSAStartup()? It would seem not, since I can call winsock functions without it. Can I rely on that?
 
May 20, 2008
12,165
133
Syracuse, NY, USA
On Wed, 02 Mar 2011 22:14:10 -0500, you wrote:

|---Quote (Originally by vefatica)---
|Do plugins need to call WSAStartup()? It would seem not, since I can call winsock functions without it. Can I rely on that?
|---End Quote---
|
|I certainly wouldn't rely on it. TCC doesn't call WSAStartup, so if you want to use an API that needs it, you'll have to do it yourself.

Hmmm! I have a plugin which successfully calls gethostbyname() without first
calling WSAStartup(). Could it be that IPWorks is starting up Winsock (and
leaving it started)?
 

rconn

Administrator
Staff member
May 14, 2008
12,556
167
Hmmm! I have a plugin which successfully calls gethostbyname() without first calling WSAStartup(). Could it be that IPWorks is starting up Winsock (and leaving it started)?

I have no idea. But you'd have to be crazy to rely on undocumented behavior by unknown third-party dll's! (And besides, it wouldn't work in TCC/LE, which doesn't load IPWorks.)
 
May 20, 2008
12,165
133
Syracuse, NY, USA
On Wed, 02 Mar 2011 23:03:49 -0500, you wrote:

|I have no idea. But you'd have to be crazy to rely on undocumented behavior by unknown third-party dll's!

Yeah! I put WSAStartup() back in.