def close_connection(self, ssock: ssl.SSLSocket): if ssock: timer = start_timer() ssock.shutdown(socket.SHUT_RDWR) self.results['ssl.shutdown.time.perf'], self.results[ 'ssl.shutdown.time.process'] = stop_timer(*timer) ssock.close()