在我写软件中,写了下面的代码,用它来实现对TClientSocket的端口的修改及Socket的启动,可是为什么在修改完之后(Socket也已启动并经连接成功)再去判断Socket.active属性的时候却是false?

Procedure Socket_Init();
var
  Ini:TIniFile;
begin
  try
    Ini:=TIniFile.Create(PubIniFileName);
    Form_main.ClientSocket_main.Active:=false;
    Form_main.ClientSocket_main.Port:=StrToInt(Ini.ReadString('Socket','Port','8000'));
    Form_main.ClientSocket_main.Host:=Ini.ReadString('Socket','Adress','127.0.0.1');
  except
    Ini.Free;
  end;
  Ini.Free;
  try
    Form_main.ClientSocket_main.Active:=true;
  except
  end;
end;

相关文章:

  • 2022-02-18
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2021-12-30
猜你喜欢
  • 2022-12-23
  • 2021-09-23
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案