Linux know cloudy.

Linux version: ubuntu-14.04.4-desktop-amd64. I installed the latest version of Lazarus by downloading from off site: 1.6.0. I downloaded and connected the Indy 10 library from off site: http://www.indyproject.org/sockets/fpc/index.en.aspx

Programs like ShowMessage ('Hello World!'); Successfully compiled and run.

You need to start a local server on a specific port. Do it through IdHTTPServer:

IdHTTPServer1.DefaultPort:= 8080; IdHTTPServer1.Active:= True; 

And an error occurs on the activation line:

enter image description here

I press "Continue" and the program closes. If I press "Break", then the IdThread module opens, pointing to the line:

 inherited Create(ACreateSuspended); 

enter image description here

I don `t know what all this means, and I ask you for help how to solve this problem. Also, even if you specify an exception through try except end on the same line of server activation, even it does not work and the program closes.

    1 answer 1

    Shoveled demos found a solution. The first thing to add is binding:

     procedure TForm1.Button1Click(Sender: TObject); var Binding: TIdSocketHandle; begin IdHTTPServer1.DefaultPort:= 25000; Binding:= IdHTTPServer1.Bindings.Add; Binding.IP:= '127.0.0.1'; Binding.Port:= 8080; IdHTTPServer1.Active:= True; end; 

    And the second thing in the project source, remove the {$ IFDEF UNIX} check for the cthreads module, i.e. before editing:

     uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Interfaces, Forms, unit1; 

    After editing:

     uses cthreads, Interfaces, Forms, unit1; 

    After these manipulations, the server starts successfully.