关于CLIENTSTOCKET控件问题
下面代码是放在TIMER事件中,每次用CLIENTSOCKET去连接服务器时总是错误后提示
asynchronous socket error 10060,请高手指教!~谢谢
procedure TfrmMain.TimerTimer(Sender: TObject);
var i:Integer;
begin
i := 0;
Label3.Caption := inttostr(i + 1);
try
// ClientSocket.Active := False;
ClientSocket.Host := g_hostip;
ClientSocket.Port := StrToInt(g_hostport);
ClientSocket.Active := True;
gbOk := True;
except
gi_trycnt := gi_trycnt + 1;
lbtrycnt.Caption := '失败次数:'+IntToStr(gi_trycnt);
end;
if not gbOk then exit;
//step 3 vpn connect complete
BtnUpdate.Enabled := False;
ImgOk.Picture.LoadFromFile('./ok.ico');
ImgOk.Visible := True;
lbC3.Visible := True;
MTrayIcon.HideMainForm;
Timer.Enabled := False;
ClientSocket.Active := False;
end;
问题点数:0、回复次数:0Top




