Skip to Content.
Sympa Menu

freetds - Re: [freetds] Socket Error on Win2008 Enterprise & Windows Vista Enterprise

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Paul Thurston" <pthurston AT netegrate.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Socket Error on Win2008 Enterprise & Windows Vista Enterprise
  • Date: Tue, 24 Nov 2009 01:04:58 -0500

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: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] 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

FreeTDS AT lists.ibiblio.org

http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page