2013/5/4 Ludo Brands <ludo.bra...@free.fr>

> On 05/03/2013 05:57 PM, silvioprog wrote:
> > Could you give me an example in practice? Theoretically I understand,
> > but I don't know do in practice. :/
> >
> > Now, TTcpIpServer is working well. The new problem is: when I close the
> > server with one or more clients connected, I got a memory leak.
> >
>
> Take a look at TBlockSocket.InternalCanRead and TBlockSocket.CanRead in
> synapse on how to set up select correctly. Then do something like
>
> repeat
>   if Socket.CanRead(timeout) then
>     begin
>     insock:=Socket.Accept;
>     if insock<>-1 then
>       //start working with insock
>     else
>       //deal with error
>     end;
> until ThreadTerminated;
>
> Ludo


Thank you!

-- 
Silvio Clécio
My public projects - github.com/silvioprog
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to