clix.raw: Handle (ignore, successfully) read timeouts on stdin

Sat, 10 Apr 2021 00:25:44 +0200

author
Kim Alvefur <zash@zash.se>
date
Sat, 10 Apr 2021 00:25:44 +0200
changeset 152
c729365f1091
parent 151
5398623682d7
child 153
56546fb3429b

clix.raw: Handle (ignore, successfully) read timeouts on stdin

So that net.server doesn't get upset if you're not typing something
regularly.

clix/raw.lua file | annotate | diff | comparison | revisions
--- a/clix/raw.lua	Sat Apr 10 00:25:20 2021 +0200
+++ b/clix/raw.lua	Sat Apr 10 00:25:44 2021 +0200
@@ -108,7 +108,7 @@
 				end
 			end
 			stdin = require "net.server".wrapclient(stdin, "stdin", 0, {
-				onincoming = on_incoming, ondisconnect = function () conn:close() end,
+				onincoming = on_incoming, ondisconnect = function () conn:close() end, onreadtimeout = function () return true; end
 				}, "*l");
 		else
 			if not send_xml then

mercurial