0
如何將其他端口添加到已經處於活動狀態的TCP服務器? (如果可能)將其他端口添加到已激活的TCP服務器?
類似,
procedure TForm1.FormCreate(Sender: TObject);
begin
IdTCPServer1.Bindings.Add.Port := 5555;
IdTCPServer1.Active := not IdTCPServer1.Active
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
//IdTCPServer1.Active := false;
//IdTCPServer1.Bindings.Clear;
IdTCPServer1.Bindings.Add.Port := strtoint(Edit1.Text); //so here i want to add additional port
//IdTCPServer1.Active := true;
end;
取消激活服務器,添加要監聽的端口並再次激活服務器。 – TLama
其實,你可以**添加**新的端口,而不先停用。但是你不能**刪除**端口而不停用。 –