Delphi Indy TIdHTTPServer.OnCommandGet-连接到哪个端口?

Delphi Indy TIdHTTPServer.OnCommandGet-连接到哪个端口?,delphi,indy,Delphi,Indy,我有一个可以在多个端口上访问的TIdHTTPServer(由于迁移),我需要找出当前数据(在OnCommandGet中)的来源。从哪里可以检索到正确的端口号?它位于AContext.Binding.port中 在Delphi 10.3.3中的IdHTTPServer的CommandGet处理程序中使用以下内容进行测试: AResponseInfo.ContentText := '<!DOCTYPE html><html lang="en"> + '<head&g

我有一个可以在多个端口上访问的
TIdHTTPServer
(由于迁移),我需要找出当前数据(在
OnCommandGet
中)的来源。从哪里可以检索到正确的端口号?

它位于
AContext.Binding.port

在Delphi 10.3.3中的IdHTTPServer的CommandGet处理程序中使用以下内容进行测试:

AResponseInfo.ContentText := '<!DOCTYPE html><html lang="en"> +
  '<head><title>A Test Response</title></head>' +
  '<body>Target port: ' + IntToStr(AContext.Binding.Port) +
  '</body></html>';
AResponseInfo.ContentText:='+
“测试响应”+
“目标端口:”+IntToStr(AContext.Binding.port)+
'';

我猜是来自
AContext.Connection.Socket.BoundPort
。我使用Indy online help编写了这篇文章(没有Delphi,几天内就可以从假日回来)。@TLama
BoundPort
用于客户端,而不是服务器。在这种情况下,正确的属性是
ABinding.Connection.Socket.Binding.Port
,简称为
AContext.Binding.Port