def close(self):
<EOL>if self._sock:<EOL><INDENT>with utils.ignore_except():<EOL><INDENT>self._sock.close()<EOL><DEDENT>self._sock = None<EOL><DEDENT>self._recvbuf = []<EOL>self._recvbuf_partial = '<STR_LIT>'<EOL>
Close the connection.

:param purge: If True (the default), the receive buffer will
              be purged.