Board index » delphi » TidTCPClient Reconnect

TidTCPClient Reconnect


2007-08-28 03:48:48 AM
delphi128
Hi there Koderz,
I am having problem reconnecting to TidTCPServer after a bad disconnection?
Any help ?
Using Delphi 2007
karanaso/Greece
 
 

Re:TidTCPClient Reconnect

"Sotiris Karanasios" <XXXX@XXXXX.COM>writes
Quote
I am having problem reconnecting to TidTCPServer after
a bad disconnection?

Any help ?
Your description is much too vague. You need to be more specific. Which
version of Indy are you using? What do you consider to be a "bad
disconnection" exactly? What problem are you having trying to reconnect?
Gambit
 

Re:TidTCPClient Reconnect

Hi there Gambit,
The version of Indy I am using is the one the comes with Delphi 2007.
Lets forget the bad diconnect here for a minute.
I Exit my TCPClient Application by issuing
TCPClient.Disconnect;
Self.Close;
After I re-run the application the TCPServer application wont get on the
onExecute.
on the TCPServerDisconnect I have
var nLoop: Integer;
begin
Acontext.Binding.CloseSocket;
TCPServer.Contexts.UnlockList;
// I try to find the disconnecting IP and remove it from the
TCP.....Contexts here
for nLoop := 0 to TCPServer.Contexts.LockList.Count -1 do
Begin
if TIDContext( TCPServer.Contexts.LockList.Items[nLoop] ).Binding.PeerIP
= AContext.Binding.PeerIP Then
Begin
AContext.Connection.Socket.WriteBufferClear;
AContext.Connection.Socket.WriteBufferClose;
TCPServer.Contexts.Remove(
TCPServer.Contexts.LockList.Items[nLoop] );
End;
End;
AContext.Connection.CheckForGracefulDisconnect( false ); <--
found that somewhere in internet .... duno if its correct.
TCPServer.Contexts.LockList.Pack;
TCPServer.Contexts.LockList;
I dont know if I have written cra......p here ... but plz help
Thx
karanaso/Greece
msn:XXXX@XXXXX.COM
----- Original Message -----
From: "Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>
Newsgroups: borland.public.delphi.internet.winsock
Sent: Monday, August 27, 2007 11:33 PM
Subject: Re: TidTCPClient Reconnect
Quote

"Sotiris Karanasios" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...

>I am having problem reconnecting to TidTCPServer after
>a bad disconnection?
>
>Any help ?

Your description is much too vague. You need to be more specific. Which
version of Indy are you using? What do you consider to be a "bad
disconnection" exactly? What problem are you having trying to reconnect?


Gambit