added a socket timeout to IRCServer socket objects.

This commit is contained in:
jesopo 2016-04-18 16:48:04 +01:00
parent 2015b1971c
commit 978fc5a359
No known key found for this signature in database
GPG key ID: 0BBDEB2AEFCFFCB3

View file

@ -36,6 +36,7 @@ class Server(object):
socket.SOCK_STREAM)
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
self.socket.settimeout(5.0)
if self.tls:
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
self.socket = context.wrap_socket(self.socket)