def get_req(self, start_size, end_size):
logger.debug('<STR_LIT>' % (start_size, end_size))<EOL>opener = request.build_opener()<EOL>content_range = '<STR_LIT>'.format(start_size, end_size)<EOL>opener.addheaders = [<EOL>('<STR_LIT>', content_range),<EOL>('<STR_LIT>', const.USER_AGENT),<EOL>('<STR_LIT>', const.PAN_REFERER),<EOL>]<EOL>for i in range(RETRIES):<EOL><INDENT>try:<EOL><INDENT>return opener.open(self.url, timeout=self.timeout)<EOL><DEDENT>except OSError:<EOL><INDENT>logger.error(traceback.format_exc())<EOL>self.queue.put((self.id_, BATCH_ERROR), block=False)<EOL>return None<EOL><DEDENT>except:<EOL><INDENT>self.queue.put((self.id_, BATCH_ERROR), block=False)<EOL>return None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>
打开socket