#NEWLINE# @ classmethod #NEWLINE# def __read_pp_initial( cls , sock ) : #NEWLINE# #INDENT# buf = bytearray ( 8 ) #NEWLINE# read = b'' #NEWLINE# while ( len ( read ) < len ( buf ) ) : #NEWLINE# #INDENT# where = memoryview ( buf ) [ len ( read ) : ] #NEWLINE# read_n = sock . recv_into ( where , ( 8 - len ( read ) ) ) #NEWLINE# assert read_n , 'Received EOF during proxy protocol header' #NEWLINE# read = memoryview ( buf ) [ 0 : ( len ( read ) + read_n ) ] . tobytes ( ) #NEWLINE# #UNINDENT# return read