(self)
Shutdowns then closes the underlying connection.
Shutdowns then closes the underlying connection.
Shutdowns then closes the underlying connection .
def close_connection(self):
        """
        Shutdowns then closes the underlying connection.
        """
        if self.sock:
            try:
                self.sock.shutdown(socket.SHUT_RDWR)
                self.sock.close()
            except:
                pass
            finally:
                self.sock = None
def close_connection ( self ) : if self . sock : try : self . sock . shutdown ( socket . SHUT_RDWR ) self . sock . close ( ) except : pass finally : self . sock = None