Indy on MacOS lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- egrobler · 2020-12-30 10:57 Hi, I am trying this Indy code on Catalina (x86_64-darwin-cocoa) with the firewall disabled. (Lazarus 2.0.11 and FPC 3.2.0) If I set port 80 I get a message 'Could not bind socket' as expected. However when I try an open port the app just crashes. Is macOs terminating my app because of security or is there another cause? (My app works on Linux but not macOS) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.TestIndy;var Server : TIdTCPServer;  Binding: TIdSocketHandle;begin  Server := TIdTCPServer.Create(Self);  Binding := Server.Bindings.Add;  Binding.IPVersion := Id_IPv4; //optional: forces the Binding to work in Id_IPV4 mode.  Binding.IP := '127.0.0.1';  Binding.Port := 9000;  //if Port 80 Message 'Could not bind socket', if port 9000 app crashes  Server.OnExecute := @OnIndyTestExecute;  Server.Active := True;end; procedure TForm1.OnIndyTestExecute(AContext: TIdContext);begin   //end; ---------------------------------------------------------------------- Jonas Maebe · 2020-12-30 11:04 Try running it in the debugger to see where it stops and why. ---------------------------------------------------------------------- egrobler · 2020-12-31 00:03 It crashed when creating a TIdThread. Seems cthreads must be added in the project file for macOS as well? However the Lazarus IDE only enables it for Linux? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF} ---------------------------------------------------------------------- Jonas Maebe · 2020-12-31 00:07 Note that it checks for UNIX, not LINUX. UNIX is also defined for Darwin/macOS/iOS. And yes, Darwin indeed also requires cthreads. ---------------------------------------------------------------------- egrobler · 2020-12-31 02:39 //Note that it checks for UNIX, not LINUX That makes sense, thanks for the help everyone :-)