problem synapse on mac lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- xinyiman · 2016-05-14 09:21 Hello guys, i have a problem. A simple program made synapse that works well both on linux than on windows on mac does not work. It 'a multithreaded server can query with telnet. Does anyone know if there is any known bug or I have forgotten a parameter? Launching a terminal server appears this error: ./serverSock Exception at 00000000: Exception: . Thank you ---------------------------------------------------------------------- xinyiman · 2016-05-14 10:04 I solved the first problem, just turn this into lpr file ccodice from this 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 TMyServer.DoRun;var  ErrorMsg: String;  app: TTCPEchoDaemon;begin  // quick check parameters     ErrorMsg:=CheckOptions('h','help');  if ErrorMsg='' then begin    ShowException(Exception.Create(ErrorMsg));  Terminate;    Exit;  end;      // parse parameters  if HasOption('h','help') then begin    WriteHelp;    Terminate;    Exit;  end;   { add your program here }  app:=TTCPEchoDaemon.create;  app.Execute;  // stop program loop  Terminate;end;     to this (it seems strange that this creates problems, however, solves the problem mentioned above). 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 TMyServer.DoRun;var  ErrorMsg: String;  app: TTCPEchoDaemon;begin  // quick check parameters  {   ErrorMsg:=CheckOptions('h','help');  if ErrorMsg='' then begin    ShowException(Exception.Create(ErrorMsg));  Terminate;    Exit;  end;   }   // parse parameters  if HasOption('h','help') then begin    WriteHelp;    Terminate;    Exit;  end;   { add your program here }  app:=TTCPEchoDaemon.create;  app.Execute;  // stop program loop  Terminate;end;     There remains the problem that when I connect with telnet does not behave as I expect. Why does the telnet connection to the server, but when trying to send a string (any) the server throws him out. And I do not understand why ---------------------------------------------------------------------- rvk · 2016-05-14 13:51 Quote from: xinyiman on May 14, 2016, 12:04:57 pmCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   ErrorMsg:=CheckOptions('h','help');  if ErrorMsg='' then begin to this (it seems strange that this creates problems, however, solves the problem mentioned above). How do you mean strange? You call CheckOptions and if that states the options are valid (through an ErrorMsg) you show an exception and exit your program. Did you mean to write? 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   // quick check parameters  ErrorMsg:=CheckOptions('h','help');  if ErrorMsg <> '' then begin                 // NOTICE the  <> instead of =    ShowException(Exception.Create(ErrorMsg));    Terminate;    Exit;  end; I'm wondering... you say this program runs on Linux and Windows. ARE YOU SURE? On those, the program would exit immediately, wouldn't it? (without changing that = to <>) Next... you have 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   { add your program here }  app:=TTCPEchoDaemon.create;  app.Execute;  // stop program loop  Terminate;Here your thread is started and control immediately returns to the main program. That ones terminates... so all started threads also terminate (or are sent the terminate signal). You shouldn't terminate the main program but wait for the thread to terminate before ending your program.