由于我监听端口是读取其它地方的,可是我在程序运行期间,更改端口信息,都不会更改成功。代码如下:IdTCPServer.active:=false;
IdTCPServer.defaultport:=edit1.text;
IdTCPServer.active:=true;执行完如上代码,监听端口依然没有改过来。
IdTCPServer.defaultport:=edit1.text;
IdTCPServer.active:=true;执行完如上代码,监听端口依然没有改过来。
调试欢乐多
IdTCPServer1.Bindings.Clear;
with IdTCPServer1.Bindings.Add do
begin
Port := 9800;
IP := '127.0.0.1';
end;
IdTCPServer1.Active := true;
IdTCPServer1.Bindings.Clear;
with IdTCPServer1.Bindings.Add do
begin
Port := StrToIntDef(Edit1.Text, 9000);
IP := '127.0.0.1';
end;
IdTCPServer1.Active := true;