Changeset

11810:fe0cdbad19c3 0.11

net.server_epoll: Close sockets added after shutdown signal (fixes #1670) This should ensure that sockets get closed even if they are added after the quit signal. Otherwise they may keep the server alive.
author Kim Alvefur <zash@zash.se>
date Mon, 20 Sep 2021 14:42:18 +0200
parents 11809:49cfd3628d9d
children 11811:ae43166fe931
files net/server_epoll.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Sat Sep 11 22:26:50 2021 +0200
+++ b/net/server_epoll.lua	Mon Sep 20 14:42:18 2021 +0200
@@ -743,6 +743,12 @@
 	if quit then
 		quitting = "quitting";
 		closeall();
+		addtimer(1, function ()
+			if quitting then
+				closeall();
+				return 1;
+			end
+		end);
 	else
 		quitting = nil;
 	end