0

Indy version: 10.5.8.0 Sometimes program cant disconnect, there is a socket error (i guess there was a problem with server or internet connection) after that is not possible to connect again, app needs to be rebooted. Thanks for help.

procedure TForm1.Button1Click(Sender: TObject);
begin
  try
    IdIRC1.Connect;
    if IdIRC1.Connected then
      IdIRC1.Join('#' + Edit3.Text);
  except
  end;
end;

procedure TForm1.IdIRC1Connected(Sender: TObject);
begin
  IdIRC1.IOHandler.DefStringEncoding := IndyUTF8Encoding;
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
  IdIRC1.Disconnect();
end;
  • 2
    What is the actual error, on which line? 10.5.8 is old, the latest version is 10.6.0, have you tried upgrading yet? When reconnecting after an error, try clearing the IOHandler.InputBuffer of unread data before calling Connect(). – Remy Lebeau Dec 06 '13 at 17:30
  • Error is 10054 or 10060 (dont remeber). I think is 54 cause i have this link in browser history http://stackoverflow.com/questions/10516579/recovering-from-connection-reset-by-peer-indy-tcp-client – user3075132 Dec 06 '13 at 18:11
  • I will try once again make a upgrade, maybe this time will be sucessful. If im not mistaken i already tried with IOHandler.InputBuffer, but will check again. Hard to test right now, cause problrems in my app is when twitch chat servers has problem. – user3075132 Dec 06 '13 at 18:13
  • i had this earlier, but it doesnt help (message box appeared) IdIRC1.Connect; if IdIRC1.Connected then IdIRC1.Join('#' + Edit3.Text); except try IdIRC1.Disconnect; IdIRC1.IOHandler.InputBuffer.Clear; except ShowMessage('!!!!!!!!!!!!!Nie można rozłączyć się') end; – user3075132 Dec 06 '13 at 18:35
  • What happens if you recreate the component (object) instead of restarting app? – Marcus Adams Dec 06 '13 at 22:00
  • how to recreate component? I just put IdIRC on Form – user3075132 Dec 07 '13 at 12:12
  • today i had this on app exit http://pastebin.com/hagqYtGq any idea? – user3075132 Dec 20 '13 at 14:12

0 Answers0