aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-10 22:10:26 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-10 22:10:26 +0200
commitf5afc242a0e463377e691b071d7d0c4c07adbd60 (patch)
tree8ba4ff3e2b08539b1c4499240142ef2004a105e2
parentm + load configuration script (diff)
downloadnightshift-f5afc242a0e463377e691b071d7d0c4c07adbd60.tar.gz
nightshift-f5afc242a0e463377e691b071d7d0c4c07adbd60.tar.bz2
nightshift-f5afc242a0e463377e691b071d7d0c4c07adbd60.tar.xz
make the size of the backlog configurable
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rwxr-xr-xsrc/nightshift.py9
1 files 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<str>? 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: