【发布时间】:2013-06-29 04:48:51
【问题描述】:
德尔福版本:XE2,
印地版:10.5.8.0。
我有三个程序并且一切正常,直到互联网连接丢失。什么时候会发生,然后我会尝试发送消息,然后当互联网恢复时我无法重新连接。无法关闭程序(关闭程序后不可见,但将使用 100 cpu 使用率)。如果没有“尝试,异常”,IdIRC1.Say 和 Close 上会有一个 Socket Error #1053。感谢您的帮助。
///Connection:
procedure TForm1.Button5Click(Sender : TObject);
begin
try
IdIRC1.Nickname := 'zzz';
IdIRC1.Password := 'kkk';
if IdIRC1.Connected then
IdIRC1.Disconnect;
IdIRC1.Connect;
IdIRC1.Join('#' + edit3.Text);
except
ShowMessage('ggg');
end;
end;
///Send message:
procedure TForm1.Button3Click(Sender : TObject);
begin
try
IdIRC1.Say('#' + edit3.Text, edit2.Text);
if (edit2.Text <> '') and (IdIRC1.Connected) then
begin
memo6.Lines.Add(edit2.Text);
Edit2.Clear;
end
else
ShowMessage('xxx');
except
ShowMessage('yyy');
end;
end;
///On close:
try
IdIRC1.Disconnect;
except
end;
【问题讨论】: