When my Tcpclient is working , with this code :
TCPClient.Disconnect;
TCPClient.Connect;
I get "raised exception class EIdAlreadyConnected with message 'Already connected.'." error still (whereas , it has been disconnected before) .
So , how can i disconnect it totally ?
Thank you
using at indy 10 you must sure inputbuffer is empty.
if idTcpClient.connected then
begin
idTcpClient.IOHandler.InputBuffer.clear;
idTcpClient.Disconnect;
end;