当套接字无法连接到主机时,我希望我的套接字连接到备份主机,我试过这个:
if prclient.Socket.connected = false then
begin
prclient.Active := false;
prclient.Port := PORT;
prclient.Host := HOST;
prclient.Active := true;
prclient.Open;
sleep(500);
if prclient.Socket.Connected = false then
begin
prclient.Active := false;
prclient.Host := BACKUPHOST;
prclient.Active := true;
prclient.Open;
end;
end;
但现在他根本连不上。谁知道工作脚本?