diff --git a/paramiko/packet.py b/paramiko/packet.py index 38a6d4b..2887bde 100644 --- a/paramiko/packet.py +++ b/paramiko/packet.py @@ -156,7 +156,6 @@ class Packetizer (object): def close(self): self.__closed = True - self.__socket.close() def set_hexdump(self, hexdump): self.__dump_packets = hexdump diff --git a/paramiko/transport.py b/paramiko/transport.py index fd6dab7..0197ced 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -400,7 +400,6 @@ class Transport (threading.Thread): @since: 1.5.3 """ - self.sock.close() self.close() def get_security_options(self): @@ -614,11 +613,10 @@ class Transport (threading.Thread): """ if not self.active: return - self.active = False - self.packetizer.close() - self.join() + self.stop_thread() for chan in self._channels.values(): chan._unlink() + self.sock.close() def get_remote_server_key(self): """ @@ -1391,6 +1389,8 @@ class Transport (threading.Thread): def stop_thread(self): self.active = False self.packetizer.close() + while self.is_alive(): + self.join(10) ### internals...