Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jun : Very strange error in IdIOHandler?
| Subject: | Very strange error in IdIOHandler? |
| Posted by: | "Guillem" (guillemvicens-nospam@clubgreenoasis.com) |
| Date: | Wed, 29 Jun 2005 13:35:28 |
Hi,
i've got one client and one middle-tier server communicating via TCP/IP.
Both work with Indy 10.0.20. Basically the client (using TidTCPClient)
connects to the server (using TidTCPServer) and then sends some strings for
login purposes. This worked fine in Indy 9, and until now in Indy 10. Btw,
using D2005 Pro SP3 on WXP SP2, if that should make any difference.
Now every time my client tries to connect, it receives a "Connection Closed
Gracefully" exception, when trying to use Writeln. The server side code,
which is in the OnExecute event handler does not even trigger. Here is my
code:
Client side
----------
function TVentanaDatos.PedirConexionServidor(miPass: string; var nivel:
integer): string;
var
respuesta: string;
begin
IdTCPCliente.Connect; <--- works fine
try
IdTCPCliente.Socket.WriteLn(PETICCONX); <----- here i get the
exception. PETICCONX is a string constant
IdTCPCliente.Socket.WriteLn(MI_ID);
IdTCPCliente.Socket.WriteLn(miPass);
respuesta := IdTCPCliente.Socket.Readln;
//in case the connection is allowed
if respuesta = CONEXACEP then
begin
//we read the permitted level of access for that client
nivel := StrToInt(IdTCPCliente.Socket.ReadLn);
end;
Result := respuesta; //depending on the answer the client will do one
thing or another
finally
IdTCPCliente.Disconnect;
end;
end;
I tried using "Debug DCU's", but it gets into the instruction
Write(AOut + EOL);
which is already low level ASM. Unfortunately, my ASM and Windows low level
knowledge is a bit oxidated... :)
I'm not sure if something got changed from the last time i had a look at
that app, since it's a project i haven't touched for a month or so, but my
guess would be nothing was changed since the last time it worked. Could this
be a bug? Or something in the WinSock underlying my program that got
screwed? I tried already deleting the .dcu's but didn't work :(
Hope someone can help me
--
Best regards :)
Guillem Vicens
Dep. informática Green Service SA
www.clubgreenoasis.com
--
In order to send me a mail, remove the -nospam