chg: [server] add tcpkeepalive

pull/23/head
Terrtia 2019-04-03 11:55:15 +02:00
parent 8da1bce74a
commit 5d923a39e2
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 3 additions and 0 deletions

View File

@ -124,6 +124,9 @@ class D4_Server(Protocol, TimeoutMixin):
self.buffer = b''
logger.debug('buffer timeout, session_uuid={}'.format(self.session_uuid))
def connectionMade(self):
self.transport.setTcpKeepAlive(1)
def connectionLost(self, reason):
redis_server_stream.sadd('ended_session', self.session_uuid)
self.setTimeout(None)