TidHTTP.host / .port

Giganews Newsgroups
Subject: TidHTTP.host / .port
Posted by:  Pete d'Oronzio [pdmagic] (myfirstna…@pdmagic.com)
Date: Sun, 21 Sep 2008

Hi all!

I've just found some code for dealing with a piece of hardware I
have.  The code uses Indy components to do its tcp/ip communication.
I've got Indy v10 on my machine (plus the version Intraweb includes)
and I'm familiar with many of the components.

This piece of code contains a section that looks like this:

  with IdHTTP1 do
  try
    Host := AIp;
    Port := APort;
    Request.BasicAuthentication := True;
    ReadTimeout := BTimeOut;
    if not Connected then Connect(ATimeOut);
    Result := Connected;
    if Result then
    begin
      ACmd := Format(SetCmd,[AUser,APass,AIP,APort,'Get','']);
      AList.CommaText := Get(ACmd);
      AList := MakeGetCMD(AList);
    end;
  finally
    DisconnectSocket;
    Result := AList.Count > 0;
  end;

Note that it addresses properties called host and port.  It looks
(from the source) like these were removed and replaced with
function SetHostAndPort: TIdHTTPConnectionType;

However - I'm not sure as to how to set things up to use this
function.

Where are host and port now set, and if you know, why were they
moved.  (knowing the logic might help me understand how to use them)

Thanks!

-Pete

Replies