freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "David Nsengiyumva" <davidn AT finsolutions.co.za>
- To: <freetds-request AT lists.ibiblio.org>
- Cc: jklowden AT schemamania.org, freetds-bounces AT lists.ibiblio.org, freetds AT lists.ibiblio.org
- Subject: [freetds] Win32 and FreeTDS
- Date: Mon, 8 Sep 2003 20:43:20 +0200
I have compiled and built a Win32 lib from FreeTDS source code and I am
trying to use it. I've built it with Borland C++ Builder 6.0. The problem I
am having now is that I can create successfully the socket in the
"tds_connect(TDSSOCKET * tds, TDSCONNECTINFO * connect_info)" method
(login.c file in tds) and I set the I/O mode of the socket to non-blocking
using the ioctlsocket function (because that's what it has to be). I connect
successfully to the server but because it's a non-blocking socket there is
no way I can know that the method completed successfully. Because
non-blocking sockets don't actually wait for the successfull completion of
the operation. Anyway I've checked the log files and I can see the sent and
received headers and packets.
But the problem is that when I try to execute a query then the select
function in the "tds_check_socket_write(TDSSOCKET * tds)" method (write.c
file in tds) return an error (code 10038) which means that:
WSAENOTSOCK (10038)
Socket operation on non-socket.
An operation was attempted on something that is not a socket. Either the
socket handle parameter did not reference a valid socket, or for select, a
member of an fd_set was not valid.
And obviously the writting will then not succeed.
What can be wrong??? Can anybody help please????
I've set the fd_set members correctly using FD_SET methods...
N.B:
----
I've kind of hard coded some required data such as the Db Hostname. I've
actually used the gethostbyname function from winsock to resolve the IP
address of the server given its name and it does actually works...And I've
done all the initialization required (WSAStartup) before using the winsock
functions. And even SAMETHING happens when I use a blocking socket!!! This
is kind of urgent so if you've got a hint or any suggestions please let me
know asap....Thanx a lot
Here is how my log looks like :
Starting log file with debug level 99.
2003-09-08 20:28:08 iconv library not employed, relying on ISO-8859-1
compatibility
2003-09-08 20:28:08 Connecting addr 10.0.3.73 port 1433 with TDS version 7.0
2003-09-08 20:28:10 inside tds_process_login_tokens()
Received header @ 2003-09-08 20:28:10
0000 04 01 01 bc 00 36 01 00 |.....6..|
Received packet @ 2003-09-08 20:28:10
0000 e3 21 00 01 09 4e 00 6f 00 72 00 74 00 68 00 77 |.!...N.o .r.t.h.w|
0010 00 69 00 6e 00 64 00 06 6d 00 61 00 73 00 74 00 |.i.n.d.. m.a.s.t.|
0020 65 00 72 00 ab 74 00 45 16 00 00 02 00 28 00 43 |e.r..t.E .....(.C|
0030 00 68 00 61 00 6e 00 67 00 65 00 64 00 20 00 64 |.h.a.n.g .e.d. .d|
0040 00 61 00 74 00 61 00 62 00 61 00 73 00 65 00 20 |.a.t.a.b .a.s.e. |
0050 00 63 00 6f 00 6e 00 74 00 65 00 78 00 74 00 20 |.c.o.n.t .e.x.t. |
0060 00 74 00 6f 00 20 00 27 00 4e 00 6f 00 72 00 74 |.t.o. .' .N.o.r.t|
0070 00 68 00 77 00 69 00 6e 00 64 00 27 00 2e 00 0c |.h.w.i.n .d.'....|
0080 46 00 49 00 4e 00 53 00 4f 00 4c 00 53 00 51 00 |F.I.N.S. O.L.S.Q.|
0090 4c 00 44 00 45 00 56 00 00 00 00 e3 17 00 02 0a |L.D.E.V. ........|
00a0 75 00 73 00 5f 00 65 00 6e 00 67 00 6c 00 69 00 |u.s._.e. n.g.l.i.|
00b0 73 00 68 00 00 ab 72 00 47 16 00 00 01 00 27 00 |s.h...r. G.....'.|
00c0 43 00 68 00 61 00 6e 00 67 00 65 00 64 00 20 00 |C.h.a.n. g.e.d. .|
00d0 6c 00 61 00 6e 00 67 00 75 00 61 00 67 00 65 00 |l.a.n.g. u.a.g.e.|
00e0 20 00 73 00 65 00 74 00 74 00 69 00 6e 00 67 00 | .s.e.t. t.i.n.g.|
00f0 20 00 74 00 6f 00 20 00 75 00 73 00 5f 00 65 00 | .t.o. . u.s._.e.|
0100 6e 00 67 00 6c 00 69 00 73 00 68 00 2e 00 0c 46 |n.g.l.i. s.h....F|
0110 00 49 00 4e 00 53 00 4f 00 4c 00 53 00 51 00 4c |.I.N.S.O .L.S.Q.L|
0120 00 44 00 45 00 56 00 00 00 00 e3 0f 00 03 05 69 |.D.E.V.. .......i|
0130 00 73 00 6f 00 5f 00 31 00 01 00 00 e3 0b 00 05 |.s.o._.1 ........|
0140 04 31 00 30 00 33 00 33 00 00 e3 0f 00 06 06 31 |.1.0.3.3 .......1|
0150 00 39 00 36 00 36 00 30 00 39 00 00 ad 36 00 01 |.9.6.6.0 .9...6..|
0160 07 00 00 00 16 4d 00 69 00 63 00 72 00 6f 00 73 |.....M.i .c.r.o.s|
0170 00 6f 00 66 00 74 00 20 00 53 00 51 00 4c 00 20 |.o.f.t. .S.Q.L. |
0180 00 53 00 65 00 72 00 76 00 65 00 72 00 00 00 00 |.S.e.r.v .e.r....|
0190 00 08 00 02 f8 e3 13 00 04 04 34 00 30 00 39 00 |........ ..4.0.9.|
01a0 36 00 04 34 00 30 00 39 00 36 00 fd 00 00 00 00 |6..4.0.9 .6......|
01b0 00 00 00 00 |....|
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is ab(INFO)
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is ab(INFO)
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is
e3(ENVCHANGE)
2003-09-08 20:28:10 increasing block size from 4096 to 4096
2003-09-08 20:28:10 inside tds_process_default_tokens() marker is fd(DONE)
2003-09-08 20:28:10 inside tds_process_end() more_results = 0, was_cancelled
= 0
2003-09-08 20:28:10 inside tds_process_default_tokens() setting state to
COMPLETED
Sending packet @ 2003-09-08 20:28:12
0000 01 01 00 22 00 00 01 00 73 00 65 00 6c 00 65 00 |...".... s.e.l.e.|
0010 63 00 74 00 20 00 40 00 40 00 73 00 70 00 69 00 |c.t. .@. @.s.p.i.|
0020 64 00 |d.|
Received header @ 2003-09-08 20:28:12
0000 04 01 00 1d 00 36 01 00 |.....6..|
Received packet @ 2003-09-08 20:28:12
0000 81 01 00 00 00 00 00 34 00 d1 36 00 fd 10 00 c1 |.......4 ..6.....|
0010 00 01 00 00 00 |.....|
2003-09-08 20:28:12 processing result tokens. marker is 81(TDS7_RESULT)
2003-09-08 20:28:12 tds7_get_data_info:1083:
type = 52 (smallint)
column_varint_size = 0
colname =
colnamelen = 0
2003-09-08 20:28:12 processing row tokens. marker is d1(ROW)
2003-09-08 20:28:12 processing row. column is 0 varint size = 0
2003-09-08 20:28:12 processing row. column size is 2
2003-09-08 20:28:12 clearing column 0 NULL bit
2003-09-08 20:28:12 processing row tokens. marker is fd(DONE)
2003-09-08 20:28:12 inside tds_process_end() more_results = 0, was_cancelled
= 0
2003-09-08 20:28:12 inside tds_process_result_tokens() state is COMPLETED
2003-09-08 20:28:12 leaving tds_process_login_tokens() returning 1
2003-09-08 20:28:12 leaving ct_connect() returning 1
2003-09-08 20:28:17 inside ct_cmd_alloc()
2003-09-08 20:29:11 inside ct_command()
2003-09-08 20:29:12 inside ct_send()
Sending packet @ 2003-09-08 20:29:26
0000 01 01 00 50 00 00 01 00 53 00 45 00 4c 00 45 00 |...P.... S.E.L.E.|
0010 43 00 54 00 20 00 43 00 61 00 74 00 65 00 67 00 |C.T. .C. a.t.e.g.|
0020 6f 00 72 00 79 00 4e 00 61 00 6d 00 65 00 20 00 |o.r.y.N. a.m.e. .|
0030 46 00 52 00 4f 00 4d 00 20 00 43 00 61 00 74 00 |F.R.O.M. .C.a.t.|
0040 65 00 67 00 6f 00 72 00 69 00 65 00 73 00 3b 00 |e.g.o.r. i.e.s.;.|
David
- [freetds] Win32 and FreeTDS, David Nsengiyumva, 09/08/2003
Archive powered by MHonArc 2.6.24.