Re: Socket Error on Win2008 Enterprise & Windows Vista Enterprise

"Paul Thurston" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <ABB5AA84226A457494A24D6171E1D4A9@Paul>
James:

 

I found the bug in the code. 

The Windows build (using VC9) is not calling INITSOCKET() which should be
set to _tds_socket_init for WIN32.

 

When I add the function call INITSOCKET() to int tds_open_socket(TDSSOCKET *
tds, const char *ip_addr, unsigned int port, int timeout), near the
beginning of that function call, everything works just fine.

 

The line is added at line 200 of net.c

 

Thanks,

 

Paul

 

 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of James K. Lowden
Sent: Tuesday, November 24, 2009 12:54 AM
To: FreeTDS Development Group
Subject: Re: [freetds] Socket Error on Win2008 Enterprise & Windows Vista
Enterprise

 

Paul Thurston wrote:

> FreeTDS is unable to make socket connections on Win2008 Enterprise &

> Windows Vista Enterprise,

...

> log.c:190:Starting log file for FreeTDS 0.65

      (upgrade ....)

> net.c:210:Connecting to 10.10.33.71 port 1433 (TDS version 8.0)

> util.c:334:tdserror(009BBBC0, 00A87810, 20008, 0)

> dblib.c:7782:dbperror(00A87060, 20008, 0)

> dblib.c:7835:20008: "Unable to open socket"

 

Does telnet work?  I'll bet the operating system is denying access. 

Search the web for "vista permission socket open" and you'll find you have

company.  

 

Memo to file: When compiling for Win32, it would be nice to call

FormatMessage() to get something printable for the log.  Basically it

seems to mean replacing strerror(3) with 

 

      const char *sock_strerror(int err) {

#ifdef _WIN32 

      FormatMessage(...);

      /* ... */

#else

      return strerror(err);

#endif

      }

 

wherever Win32 sockets might be involved.  Sigh.  

 

--jkl

_______________________________________________

FreeTDS mailing list

[email protected]

http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.