[SOLVED] idTCPServer in a daemon. lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Greg · 2013-02-19 21:43 Hi, I've built a thread which host an IdTCPServer and handles my protocol . Started in a console app : No problem, the thread is ok and running as intended. Next I want to use this class in a Daemon using LazDaemon. But, when the thread initialize it locks on the  idTCPServer.Active := True; I can't get deeper in the code as i can't get my debugger working when running a daemon :/ ---------------------------------------------------------------------- BigChimp · 2013-02-20 06:39 Perhaps you can adapt the approach in http://wiki.lazarus.freepascal.org/CGI_Web_Programming#Debugging_CGI BTW what is your OS, Lazarus version ---------------------------------------------------------------------- Greg · 2013-02-20 07:25 Hi BigChump, Check my signature . I take a look a your suggestion. Thanks. ---------------------------------------------------------------------- Greg · 2013-02-20 07:49 ok. I found the reason : WriteLn used for debugging. If i drop these lines, the service runs nicely. I would like to understand why indeed. A multithreading problem ? ---------------------------------------------------------------------- BigChimp · 2013-02-20 08:06 Quote from: Greg on February 20, 2013, 08:25:34 amCheck my signature . Oops, sorry On Windows, I wouldn't think a service has a console so writelns would fail. On Linux, IIRC, daemons *can* write to stdout... but perhaps/probably I'm wrong...