diff --git a/monkey/infection_monkey/transport/tcp.py b/monkey/infection_monkey/transport/tcp.py index 22cff5d4a..9b017aa41 100644 --- a/monkey/infection_monkey/transport/tcp.py +++ b/monkey/infection_monkey/transport/tcp.py @@ -61,8 +61,8 @@ class TcpProxy(TransportProxyBase): except socket.timeout: continue + dest = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: - dest = socket.socket(socket.AF_INET, socket.SOCK_STREAM) dest.connect((self.dest_host, self.dest_port)) except socket.error as ex: source.close()