From cb853ea36cb7bb3d947a593f746bc242c1854d47 Mon Sep 17 00:00:00 2001 From: Juan Pablo Fernandez Date: Fri, 26 Oct 2012 19:33:31 -0400 Subject: [PATCH] Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set --- listener.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/listener.c b/listener.c index a78ca0d6..d21e8dbe 100644 --- a/listener.c +++ b/listener.c @@ -741,6 +741,10 @@ iocp_listener_disable_impl(struct evconnlistener *lev, int shutdown) } LeaveCriticalSection(&as->lock); } + + if (shutdown && lev->flags & LEV_OPT_CLOSE_ON_FREE) + evutil_closesocket(lev_iocp->fd); + UNLOCK(lev); return 0; } -- 2.40.0