diff options
-rw-r--r-- | voctocore/lib/avpreviewoutput.py | 2 | ||||
-rw-r--r-- | voctocore/lib/avrawoutput.py | 2 | ||||
-rw-r--r-- | voctocore/lib/tcpmulticonnection.py | 7 |
3 files changed, 7 insertions, 4 deletions
diff --git a/voctocore/lib/avpreviewoutput.py b/voctocore/lib/avpreviewoutput.py index 3a40a00..b1bc27f 100644 --- a/voctocore/lib/avpreviewoutput.py +++ b/voctocore/lib/avpreviewoutput.py @@ -61,6 +61,6 @@ class AVPreviewOutput(TCPMultiConnection): def on_disconnect(multifdsink, fileno): if fileno == conn.fileno(): self.log.debug('fd %u removed from multifdsink', fileno) - self.close_connection(conn) + self.close_connection(conn, addr) fdsink.connect('client-fd-removed', on_disconnect) diff --git a/voctocore/lib/avrawoutput.py b/voctocore/lib/avrawoutput.py index 3c7d739..912c292 100644 --- a/voctocore/lib/avrawoutput.py +++ b/voctocore/lib/avrawoutput.py @@ -50,6 +50,6 @@ class AVRawOutput(TCPMultiConnection): def on_disconnect(multifdsink, fileno): if fileno == conn.fileno(): self.log.debug('fd %u removed from multifdsink', fileno) - self.close_connection(conn) + self.close_connection(conn, addr) fdsink.connect('client-fd-removed', on_disconnect) diff --git a/voctocore/lib/tcpmulticonnection.py b/voctocore/lib/tcpmulticonnection.py index 201ecde..5ad4ca2 100644 --- a/voctocore/lib/tcpmulticonnection.py +++ b/voctocore/lib/tcpmulticonnection.py @@ -36,7 +36,10 @@ class TCPMultiConnection(object): return True - def close_connection(self, conn): + def close_connection(self, conn, addr=None): + if addr is None: + addr = conn.getpeername() + self.currentConnections.remove(conn) - self.log.info('Disconnected Receiver %s', conn.getpeername()) + self.log.info('Disconnected Receiver %s', addr) self.log.info('Now %u Receiver connected', len(self.currentConnections)) |