Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Internet/Indy    [ Add a report in this area ]  
Report #:  118942   Status: Closed
[Android] IdUDPServer raise expeciton class EThreadNameException after activation on Android.
Project:  Delphi Build #:  19.0.13476.4176
Version:    19.0 Submitted By:   Daniel Jenne
Report Type:  Crash / Data loss / Total failure Date Reported:  9/12/2013 2:03:53 PM
Severity:    Infrequently encountered problem Last Updated: 4/15/2014 6:40:23 PM
Platform:    Google mobile OS Internal Tracking #:   44103
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
[Android] IdUDPServer raise expeciton class EThreadNameException after activation on Android.

------------
unit main;
interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs,
  IdUDPServer, IdSocketHandle, IdExceptionCore, IdGlobal;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    IdUDPServer : TIdUDPServer;
  public
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.FormCreate(Sender: TObject);
begin
  IdUDPServer := TIdUDPServer.Create(self);
  IdUDPServer.Active:=false;
//  IdUDPServer.OnUDPRead := IdUDPServerUDPRead;
  IdUDPServer.BroadcastEnabled := True;

  IdUDPServer.Bindings.Add();
  IdUDPServer.Bindings.Items[0].IP := '0.0.0.0';
  IdUDPServer.Bindings.Items[0].Port := 0;
  IdUDPServer.DefaultPort := 0;
  IdUDPServer.Active:=true;
end;

end.
------------

This is error message:
---------------------------
Debugger Exception Notification
---------------------------
Project test01.apk raised exception class EThreadNameException with message ''.
---------------------------
Break   Continue   Help  
---------------------------

And here is raise exception context (System.Classes, TThread.NameThreadForDebugging):
------------
{$IF Defined(MACOS)}
  if (getenv(EMBDBKPRESENTNAME) <> nil) or (getenv(OLDEMBDBKPRESENTNAME) <> nil) then
{$ELSEIF Defined(ANDROID)}
  if (System.DebugHook <> 0) or (getenv(EMBDBKPRESENTNAME) <> nil) then
{$ELSE}
  if (getenv(EMBDBKPRESENTNAME) <> nil) then
{$ENDIF}
  begin
    try
      raise EThreadNameException.Create(Format(cExceptionMessage, [AThreadName, AThreadID]));
    except
    end;
  end;
end;
------------
Steps to Reproduce:
Just put IdUDPServer on form and set following parameters:

Active: True
Bindings: 0.0.0.0
BroadcastEnable: True
ReuseSocket: rsFalse or rsOSDependent
ThreadedEvent: True or False
Workarounds
None
Attachment
None
Comments

Tomohiro Takahashi at 9/13/2013 6:29:00 PM -
Could you please attach sample project to reproduce/confirm your issue?

Daniel Jenne at 10/6/2013 5:34:46 PM -
Of course, here we are:

unit main;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs,
  IdUDPServer, IdSocketHandle, IdExceptionCore, IdGlobal
  ;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    IdUDPServer : TIdUDPServer;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.FormCreate(Sender: TObject);
begin
  IdUDPServer := TIdUDPServer.Create(self);
  IdUDPServer.Active:=false;
//  IdUDPServer.OnUDPRead := IdUDPServerUDPRead;
  IdUDPServer.BroadcastEnabled := True;

  IdUDPServer.Bindings.Add();
  IdUDPServer.Bindings.Items[0].IP := '0.0.0.0';
  IdUDPServer.Bindings.Items[0].Port := 0;
  IdUDPServer.DefaultPort := 0;
  IdUDPServer.Active:=true;

end;

end.

This is error message:

---------------------------
Debugger Exception Notification
---------------------------
Project test01.apk raised exception class EThreadNameException with message ''.
---------------------------
Break   Continue   Help  
---------------------------

And here is raise exception context (System.Classes, TThread.NameThreadForDebugging):

{$IF Defined(MACOS)}
  if (getenv(EMBDBKPRESENTNAME) <> nil) or (getenv(OLDEMBDBKPRESENTNAME) <> nil) then
{$ELSEIF Defined(ANDROID)}
  if (System.DebugHook <> 0) or (getenv(EMBDBKPRESENTNAME) <> nil) then
{$ELSE}
  if (getenv(EMBDBKPRESENTNAME) <> nil) then
{$ENDIF}
  begin
    try
      raise EThreadNameException.Create(Format(cExceptionMessage, [AThreadName, AThreadID]));
    except
    end;
  end;
end;


Server Response from: ETNACODE01