From 18f2b023bc2c1ea84e7690b604c196580ac8f110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sat, 29 Jun 2019 08:31:08 -0400 Subject: Make Readline non-blocking: Use a self-pipe to break the Readline loop Now that we are no longer blocking on Readline calls, we can set up a self-pipe that will let us break out of the Readline loop upon receiving a "quit" command on our local socket, thus (finally) fixing issue #143. (Thanks to https://stackoverflow.com/a/27662212 for the tip!) Fixes #143 --- src/userintf.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/userintf.h') diff --git a/src/userintf.h b/src/userintf.h index 48a4c50..2c6d96d 100644 --- a/src/userintf.h +++ b/src/userintf.h @@ -62,6 +62,7 @@ protected: private: bool end_interface; // indicates if interface loop should quit + int break_readline_loop_pipe[2]; // pipe used to interrupt Readline list all_commands; // list of all commands t_tone_gen *tone_gen; // tone generator for ringing -- cgit v1.2.3