Welcome, Guest
Username: Password: Remember me
CodeTyphon Linux OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

There is a exception when I Open IdUDPServer 12 years 4 months ago #2181

  • pcplayer
  • pcplayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
I have download CodeTyphon the day before yesterday. And I install a new Ubuntu 12.04 into a VirtualBox, and then I install CodeTyphon in it.

I start Lazarus, I have placed a button, a IdUDPServer on to the form. and I write some code in button's OnClick event handler like this:

IdUDPServer1.DefaultPort := 3467;
IdUDPServer1.Active := True;


Run this program, and when I click the button, I get a exception when it goto IdUDPServer1.Active := True;


BTW. I add 2 file -- the exception's screen picture and when I submit this topic, I got a error!

500 Internal Server Error

Fatal Error was detected!

Please contact the site owner.

Please Log in or Create an account to join the conversation.

There is a exception when I Open IdUDPServer 12 years 4 months ago #2182

  • pcplayer
  • pcplayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
the exception message is:

Please Log in or Create an account to join the conversation.

Last edit: by pcplayer.

There is a exception when I Open IdUDPServer 12 years 4 months ago #2192

  • pcplayer
  • pcplayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
I setup a break in my code, and I got the exception code here:
constructor TIdThread.Create(ACreateSuspended: Boolean; ALoop: Boolean; const AName: string);
begin
  ...
  ...


  inherited Create(ACreateSuspended);  //when program run into this line, it's popup exception. 

  ...
  ......

end;

Please Log in or Create an account to join the conversation.

There is a exception when I Open IdUDPServer 12 years 4 months ago #2193

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Thanks Sir
We will check this
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

There is a exception when I Open IdUDPServer 12 years 4 months ago #2197

  • pcplayer
  • pcplayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Thanks for your attention sir.

After some search on Internet I found that when we use Indy under Linux, we must:

1. Porject unit's uses part first line must be:
{$IFDEF UNIX}{$IFDEF UseCThreads}
   cthreads,
{$ENDIF}{$ENDIF}

I check that Lazarus from CodeTyephon has add this code for us.


2. Compiler params: In project option -- other page, add -dUseCThreads in it.

3. Set IdUDPServer IPVersion to IPV4;

And then the exception is gone. And I can set IdUDPServer1.Active := True; and IdUdpServer can receive UDP package from net.

But, IdUDPServer1.Send or SendBuffer has no effect. I cann't send any data to the net.

BTW. there is no problem like this under Delphi with Indy10.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1