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

Ewald ewald at yellowcouch.org
Fri May 3 18:22:26 CEST 2013


On 03 May 2013, at 11:30, Zaher Dirkey wrote:

> 
> On Fri, May 3, 2013 at 12:18 PM, Ewald <ewald at yellowcouch.org> wrote:
> That's true, but at least it returns control to you (= the programmer), so you can close the handles manually.
> 
> ​I am notprefer force to close any thing, that will make more bugs in your application​, while it is work fine with other programmesr without using cancel it.

Neither do I, but wasn't that what Silvio asked? [by saying: `The problem now is how to stop the "Accept" but without errors`]

I admit, killing an entire thread is a bit overkill for just getting back control from accept, but I also recall that he wanted to close the application [or am I seeing ghosts?]. But if you don't want to use pthread_cancel(), use non-blocking sockets -- In my experience though, it isn't worth the code if you just want to kill the application gracefully.

Anyway, I'm sure there are other ways to get this done (signals?), but these are two methods I know about. Each has it's bonuses and pitfalls.

--
Ewald

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130503/2668e481/attachment.html>


More information about the fpc-pascal mailing list