diff options
author | MaZderMind <github@mazdermind.de> | 2015-05-15 12:01:42 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-05-15 12:01:42 +0200 |
commit | 85371bff8cc5e70531c87b5708d3334412831a78 (patch) | |
tree | 0b9889567cd68f58e8f46e258b674b124a0ba888 /voctocore/lib/tcpmulticonnection.py | |
parent | 18af1394a8b732d94b48b8f13e78cfcae3e45a6e (diff) |
Use existing addr object where available
Diffstat (limited to 'voctocore/lib/tcpmulticonnection.py')
-rw-r--r-- | voctocore/lib/tcpmulticonnection.py | 7 |
1 files changed, 5 insertions, 2 deletions
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)) |