Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8658539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:47:33+00:00 2026-06-12T15:47:33+00:00

I am using Embarcadero RAD Studio XE2 Update 4 and the Indy package shipped

  • 0

I am using Embarcadero RAD Studio XE2 Update 4 and the Indy package shipped with it.

My intention is to find a server in LAN with broadcast from a TIdUDPClient that waits for a response from the server to get its IP. Receiving the data works fine if I use the TIdUDPClient method ReceiveString with no arguments.

But when I try to use the overloaded version found in the Indy 10 Documentation version 10.5.8.3 coming with RAD Studio, it does not compile and shows ‘E2250: There is no overloaded version of ‘ReceiveString’ that can be called with these arguments’.
Here is my code:

unit Client;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, IdBaseComponent, IdComponent, IdUDPBase,
  IdUDPClient, Vcl.StdCtrls, IdGlobal;

type
  TFormLC = class(TForm)
    UDPClient: TIdUDPClient;
    LServer: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  FormLC: TFormLC;

implementation

{$R *.dfm}

function findServer:string;
var ans, ip : string;
    port: TIdPort;
begin
  with FormLC.UDPClient do begin
    Active := True;
    BroadcastEnabled:=True;
    Broadcast('ServerRequest', 1234);
    ans := ReceiveString(ip, port);
    Active := False;
  end;
  if SameText(ans, 'ServerAccept') then
    result := ip
  else
    result := '';
end;


procedure TFormLC.Button1Click(Sender: TObject);
var ans:string;
begin
  LServer.Caption := findServer;
end;

end.

I noticed that the online documentation of Indy differs from the documentation that comes with the IDE and tried it as described there, without succes.

Any help would be great!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:47:34+00:00Added an answer on June 12, 2026 at 3:47 pm

    Your issue is caused by the with statement, you are passing the port property of the TIdUDPClient instead of the local variable port to the ReceiveString method.

    function findServer:string;
    var ans, ip : string;
        port: TIdPort;
    begin
      with FormLC.UDPClient do begin
        ....
        ans := ReceiveString(ip, port);//here you are passing the port property 
        Active := False;
      end;
      .... 
    end;
    

    As workaround rename you port local variable like so :

     function findServer:string;
    var ans, ip : string;
        vport: TIdPort;
    begin
      with FormLC.UDPClient do begin
        .... 
        ans := ReceiveString(ip, vport);//now will work
        Active := False;
      end;
    end;
    

    or even better don’t use the with statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Embarcadero RAD Studio 2010 (C++). The project file (.cbproj) has five
I'm working with Embarcadero Delphi XE2 and Firebird DB, using TIBDatabase , TIBTransaction and
I'm trying to profile a C++ project in Embarcadero RAD Studio 2010 . To
I am using bcc32 command line compiler from Borland Embarcadero. Consider this program: int
In one of my projects we are using CodeGear C++ Builder 2009 from Embarcadero.
I've downloaded embtvstools (Embarcadero TVirtualShellTools) from: http://embtvstools.svn.sourceforge.net/ However when I create a new package,
I am using Embarcadero C++Builder XE and I am trying to write 123456 to
This is a basic understanding concepts related question. Working using: Embarcadero C++ Builder What
Using SQL Server 2008 R2 we are looking for a way to select the
I have an application in Embarcadera RAD Studio 2010 (C++) . Is it possible

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.