#NEWLINE# @ gen . coroutine #NEWLINE# def _wait_for_ack( self ) : #NEWLINE# #INDENT# message = ( yield self . _pop_message ( ) ) #NEWLINE# if ( message and ( message . msgtype == 'ACK' ) ) : #NEWLINE# #INDENT# log . debug ( 'Received %r' , message ) #NEWLINE# ( yield self . _transition ( self . CONNECTED_AFTER_ACK ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( message is None ) : #NEWLINE# #INDENT# ( yield self . _transition_to_disconnected ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ProtocolError ( ( 'Received %r instead of ACK' % self ) )