#NEWLINE# def _read_buffer( self , buffer ) : #NEWLINE# #INDENT# 'Process the socket buffer, and direct the data to the correct\n        channel.\n\n        :return:\n        ' #NEWLINE# while buffer : #NEWLINE# #INDENT# ( buffer , channel_id , frame_in ) = self . _handle_amqp_frame ( buffer ) #NEWLINE# if ( frame_in is None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# self . heartbeat . register_beat ( ) #NEWLINE# if ( frame_in == 0 ) : #NEWLINE# #INDENT# self . _channel0 . on_frame ( frame_in ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _channels [ channel_id ] . on_frame ( frame_in ) #NEWLINE# #UNINDENT# #UNINDENT# return buffer