code: def close(self):
          
          self._wr_lock.acquire()
          self._rd_lock.acquire()
          try:
              self._running.clear()
              if self.socket:
                  self._close_socket()
              if self._inbound_thread:
                  self._inbound_thread.join(timeout=self._parameters['timeout'])
              self._inbound_thread = None
              self.poller = None
              self.socket = None
          finally:
              self._wr_lock.release()
              self._rd_lock.release()
docs: Close Socket.
  
          :return: