Support closing all current connection in ConnectionServer

This commit is contained in:
shortcutme 2019-04-15 15:46:53 +02:00
parent 498fd4bf01
commit b8879853d5
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -113,6 +113,11 @@ class ConnectionServer(object):
if self.stream_server:
self.stream_server.stop()
def closeConnections(self):
self.log.debug("Closing all connection: %s" % len(self.connections))
for connection in self.connections[:]:
connection.close("Close all connections")
def handleIncomingConnection(self, sock, addr):
ip, port = addr[0:2]
ip = ip.lower()