keepalive aktiviert

This commit is contained in:
+++ 2020-10-22 16:07:16 +02:00
parent 915d195d33
commit cc77f32afa
1 changed files with 3 additions and 0 deletions

View File

@ -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)