diff --git a/apistatusd.py b/apistatusd.py index 6d5a908..2f97f1b 100755 --- a/apistatusd.py +++ b/apistatusd.py @@ -233,6 +233,9 @@ def main(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as mySocket: logging.debug('Socket created') + mySocket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) + keep = mySocket.getsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE) + logging.debug('Socket keepalive: {}'format(keep)) try: mySocket.bind((config['server']['host'], int(config['server']['port']))) mySocket.listen(5)