1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WSAStartup()?

Discussion in 'Plugins' started by vefatica, Mar 2, 2011.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,971
    Likes Received:
    30
    Do plugins need to call WSAStartup()? It would seem not, since I can call winsock functions without it. Can I rely on that?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    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.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,971
    Likes Received:
    30
    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)?
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    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.)
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,971
    Likes Received:
    30
    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.
     

Share This Page