[fpc-pascal] How to close TInetServer without except?

silvioprog silvioprog at gmail.com
Fri May 3 17:57:29 CEST 2013


2013/5/3 Ludo Brands <ludo.brands at free.fr>

> On 05/02/2013 10:00 PM, silvioprog wrote:
> >
> > Lines 277 and 278. That is, I already do that. The problem now is how to
> > stop the "Accept" but without errors.
> >
> > I implemented the "Stop" method in socket, but I did not want to do it
> > this ugly way.
> >
>
> Same solution as for recv and send. Or use blocking mode with a select
> before accept, or use non blocking mode and deal with EAGAIN or
> EWOULDBLOCK. Here you seem to use blocking mode and accept will only
> return with a new connection or an error.
>
> Ludo


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.

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130503/accbce94/attachment.html>


More information about the fpc-pascal mailing list