From f5afc242a0e463377e691b071d7d0c4c07adbd60 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 10 Apr 2014 22:10:26 +0200 Subject: make the size of the backlog configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/nightshift.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nightshift.py b/src/nightshift.py index 3111a40..b9b8e7a 100755 --- a/src/nightshift.py +++ b/src/nightshift.py @@ -67,6 +67,11 @@ def setproctitle(title): setproctitle(sys.argv[0]) +backlog = 5 +''' +:int The size of the server socket's backlog +''' + red_args = None ''' :list? Raw arguments passed to redshift @@ -390,7 +395,7 @@ def do_daemon(): pass # The fill does (probably) not exist sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.bind(socket_path) - sock.listen(5) + sock.listen(backlog) # Perform daemon logic run_as_daemon(sock) @@ -459,7 +464,7 @@ def create_daemon(): pass # The fill does (probably) not exist sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.bind(socket_path) - sock.listen(5) + sock.listen(backlog) # Send signal with os.fdopen(w_end, 'wb') as file: -- cgit v1.2.3-70-g09d2