Board index » delphi » TidTCPClient Reconnect
Sotiris Karanasios
![]() Delphi Developer |
Sotiris Karanasios
![]() Delphi Developer |
TidTCPClient Reconnect2007-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 |
Remy Lebeau (TeamB)
![]() Delphi Developer |
2007-08-28 04:33:39 AM
Re:TidTCPClient Reconnect
"Sotiris Karanasios" <XXXX@XXXXX.COM>writes
QuoteI am having problem reconnecting to TidTCPServer after disconnection" exactly? What problem are you having trying to reconnect? Gambit |
Sotiris Karanasios
![]() Delphi Developer |
2007-08-28 05:00:31 AM
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
|