Hi,

I'm trying to write a TCP server with synapse blocking sockets.

I created a TThread decendent class to listen for incoming requests and it works ok, except it looks like it executes in the main thread because the console no longer responds when my class is executed and a blocking socket is created inside it.

var
Serv : TAstServer;
sRead: string;
begin

   Serv := TAstServer.Create(true);
   Serv.Execute;
   try
   while (true) do
      begin
      ReadLn(sRead);
      if (sRead = 'quit') then
         begin
         Serv.Terminate;
         break;
         end;
      end;
   finally;
      Serv.free;
      end;
end;

Execution never goes past "Serv.Execute" above.

I can post some code of the Execute method of my TThread descendant, but its just a very simple loop that tries to read the socket every 1 seconds.

If I place a breakpoint on code inside the TThread descendent's loop, execution breaks every 1 second as it should.

--

Warm Regards,

Lee

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to