OK I got the following working in a fashion. I get a connection the data is 
processed, but if I disconnect and try and connect again a socket is not 
available. What do I do now?
========================
begin
sock:=TTCPBlockSocket.create;
  with sock do
  begin
  CreateSocket;
  setLinger(true,10);
  bind('0.0.0.0','4515');
  listen;
  ClientSock:=accept;
  socket:=ClientSock;
  GetSins;
  writeln('Connected');
       repeat
          s := Recvstring(200);
          SendString(s);
          DataParse1(s);
      until false;
      end;
Sock.free;
end;
=========================
----- Original Message ----- 
From: "theo" <[EMAIL PROTECTED]>
To: "Ararat Synapse" <[email protected]>
Sent: Monday, November 06, 2006 5:49 PM
Subject: Re: [Synalist] newbie console app question


> Lloyd Thomas schrieb:
>> I thought this was the loop.
>> repeat
>>         if terminated then break;
>>         if canread(1000) then
>>           begin
>>             ClientSock:=accept;
>>             if lastError=0 then TTCPEchoThrd.create(ClientSock);
>>              writeln('Listening'); //error here not listening
>>           end;
>>       until false;
>
> Yes, would be, but it's overkill to put this in a extra thread.
> If you do this, your app is exiting after creating the listener thread.
> You can totally omit the TTCPEchoDaemon thread class in case of console
> app imho.
>
> I'd keep it simple:
> -------------------
>
> program blah...
>
> uses blah....
>
> var
>  Sock:TTCPBlockSocket;
>  ClientSock:TSocket;
>
> begin //program
> Sock:=TTCPBlockSocket.create;
>  with sock do
>    begin
>     .....etc.etc.etc
>    end;
>  Sock.free;
> end.
> ..................................
>
>
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> synalist-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/synalist-public 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to