<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def close(self):
 """Close Socket. :return: """

        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()