#NEWLINE# def _read_chunks( self ) : #NEWLINE# #INDENT# chunks = [ ] #NEWLINE# stop = False #NEWLINE# while ( not stop ) : #NEWLINE# #INDENT# stop = self . conn . recv ( ) #NEWLINE# if ( not stop ) : #NEWLINE# #INDENT# chunk = self . conn . recv_bytes ( ) #NEWLINE# chunks . append ( chunk ) #NEWLINE# #UNINDENT# self . conn . send ( True ) #NEWLINE# #UNINDENT# to_load = b'' . join ( chunks ) #NEWLINE# del chunks #NEWLINE# try : #NEWLINE# #INDENT# data = pickle . loads ( to_load ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# self . _logger . exception ( 'Could not reconstruct pickled data.' ) #NEWLINE# data = None #NEWLINE# #UNINDENT# return data