Skip to Content.
Sympa Menu

freetds - [freetds] _tds_socket_init

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] _tds_socket_init
  • Date: Thu, 10 Jan 2008 17:44:27 -0500

_tds_socket_init and _tds_socket_done are defined in tds/net.c and used
nowhere.

According to Microsoft's Win32 documentation, they should be called,
because "WSAStartup ... *must* be the first Windows Sockets function
called...." and WSACleanup must be the last one called.

To support Win32 correctly, these functions should be added to some kind
of tds_init() function that would be called by dbinit() and friends. It
can't be called at connect time (unless we keep track with a global static
or something), because a process may create more than one connection.

Another option is to do the same work in the .dll when it initializes.
That's actually much more desirable, ISTM, unless we support static Win32
libraries.

If we're not going to bother using these functions, we should probably
delete them.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page