Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS under cygwin - connections 'hang'?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Justin Schoeman <justin AT expertron.co.za>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS under cygwin - connections 'hang'?
  • Date: Fri, 03 Sep 2004 15:48:22 +0200

OK - I found the bug... It is in freetds, but _very_ obscure... Calls to connect() to the same destination port cannot occur simultaneously. This means that connect() may return EADDRINUSE if two threads try to connect to the same destination address at the same time. To rectify this problem, simply trap EADDRINUSE error codes (will have to use the SO_ERROR getsockopt() in the timeout code path), reinitialise the address parameter, and re-issue the connect. Or, as I did in the end, simply serialise connect()s.

Thanks,
-justin

Justin Schoeman wrote:
Hi all, I don't know if this is a FreeTDS, or Cygwin problem, but I thought I would try here first (well, the problem does manifest itself in the FreeTDS library ;-) ).

When my application is running, it makes multiple connections to the SQL server, one after the other. If the connections occur at a relatively low rate, then everything works fine, however, if the connection request occur very fast, then the program hangs in dbopen. No network connection request is issued.

Does anybody have any idea what is going on, or where I should start looking for problems?

The same program works perfectly under Linux.

TIA,
-justin
_______________________________________________
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