<div dir="ltr">2013/5/4 Ludo Brands <span dir="ltr"><<a href="mailto:ludo.brands@free.fr" target="_blank">ludo.brands@free.fr</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 05/03/2013 05:57 PM, silvioprog wrote:<br>
> Could you give me an example in practice? Theoretically I understand,<br>
> but I don't know do in practice. :/<br>
><br>
> Now, TTcpIpServer is working well. The new problem is: when I close the<br>
> server with one or more clients connected, I got a memory leak.<br>
><br>
<br>
Take a look at TBlockSocket.InternalCanRead and TBlockSocket.CanRead in<br>
synapse on how to set up select correctly. Then do something like<br>
<br>
repeat<br>
if Socket.CanRead(timeout) then<br>
begin<br>
insock:=Socket.Accept;<br>
if insock<>-1 then<br>
//start working with insock<br>
else<br>
//deal with error<br>
end;<br>
until ThreadTerminated;<br>
<br>
Ludo</blockquote></div><div><br></div><div style>Thank you!</div><div><br></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>