Tried and failed. I am just not sure how to correctly set up an open socket. 
This is where I am.
===========================
var
   Sock:TTCPBlockSocket;
  ClientSock:TSocket;

begin
 sock:=TTCPBlockSocket.create;
  with sock do
  begin
  CreateSocket;
  setLinger(true,10);
  bind('0.0.0.0','echo');
    Sock.socket:=ClientSock;
    sock.GetSins;
    with sock do
      begin
        repeat
        if canread(1000) then
          begin
          s := RecvPacket(60000);
          if lastError<>0 then break;
          SendString(s);
          end;
          if lastError<>0 then break;
        until false;
      end;
//  finally
    Sock.Free;
    end;
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