Skip to Content.
Sympa Menu

freetds - RE: [freetds] (no subject)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] (no subject)
  • Date: Mon, 8 Sep 2003 14:33:54 -0400

> From: David Nsengiyumva [mailto:davidn AT finsolutions.co.za]
> Sent: September 8, 2003 12:41 PM
>
> ------------------------------------------------
> Client App
> ------------------------------------------------
> ct-lib | db-lib | ODBC | JDBC | etc
> ------------------------------------------------
> TDS-lib
> ------------------------------------------------
> Network comm
> ------------------------------------------------
> DB Server
> ------------------------------------------------

Your diagram is correct, except that usually the server is not depicted at
the bottom. It's more accurate to say the server has its own stack diagram.


> What I don't understand is that if select does succeed the
> first time when
> connecting, why does it fails when I try to send a query??? What am I
> missing???

You're really asking a Win32 socket programming question. I haven't dealt
with that particular API, but from my experience I'd suggest you believe the
WSAENOTSOCK error. You're probably doing something wrong, with or without
our help.

You might want to examine the contents of the fd_set in
tds_check_socket_write(). fd_count should be one, and the unused members of
fd_array should (I would guess) be zeros. I'd expect fd_count[0] to equal
tds->s, which is the return value of socket(). There are lots of
opportunities to mangle that value via signed/unsigned mismatches.

Bug. Comparing our code to Microsoft's documentation (cf. "Deviation from
Berkeley Sockets" in MSDN), I found what looks like a bug at login.c:295.
(I doubt it's affecting you, but there may be similar things lurking.) Our
connect() call assumes any retval < 0 is an error. Microsoft's connect()
returns an *unsigned* integer, meaning that we would treat, say, 0xF0000000
as an error whereas under Win32 it's a valid descriptor. We should probably
define INVALID_SOCKET for non-Win32 environments and alter the test to use
it.

You mention you're using db-lib. Can you get src/dblib/unittests/t0001.c to
work?

Hope this is of some use.

--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.





  • [freetds] (no subject), David Nsengiyumva, 09/08/2003
    • <Possible follow-up(s)>
    • RE: [freetds] (no subject), Lowden, James K, 09/08/2003

Archive powered by MHonArc 2.6.24.

Top of Page