Hi guys,
I have a delphi application with a Indy TCPServer and TCPClient I use the AContext.Bindind.Handle for the identification of each connection (wrong?).
So I have a grid which displayed the connections and I will remove the entry after disconnection:
procedure TfrmMain.serverIndyDisconnect(AContext: TIdContext);
var I:Integer;
begin
for I := 0 to gridClients.RowCount - 1 do
begin
if gridClients.Cells[0, I] = IntToStr(AContext.Binding.Handle) then
begin
gridClients.Rows[I].Delete(I);
end;
end;
WriteLogEntry('Connection closed... (' + AContext.Binding.PeerIP+')');
end;
But in the Disconnect Event, the Handle is allready empty (Its ever 401xxxxx, so the last Integer number).
Ideas?