#NEWLINE# def _decrefAsync( self ) : #NEWLINE# #INDENT# self . _refCount -= 1 #NEWLINE# if ( ( self . _refCount == 0 ) and ( not self . closed ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# for result in self . _sendMsg ( Alert ( ) . create ( AlertDescription . close_notify , AlertLevel . warning ) ) : #NEWLINE# #INDENT# ( yield alert ) #NEWLINE# #UNINDENT# alert = None #NEWLINE# while ( not alert ) : #NEWLINE# #INDENT# for result in self . _getMsg ( ( ContentType . alert , ContentType . application_data ) ) : #NEWLINE# #INDENT# if ( result in ( 0 , 1 ) ) : #NEWLINE# #INDENT# ( yield result ) #NEWLINE# #UNINDENT# #UNINDENT# if ( result . contentType == ContentType . alert ) : #NEWLINE# #INDENT# alert = result #NEWLINE# #UNINDENT# #UNINDENT# if ( alert . description == AlertDescription . close_notify ) : #NEWLINE# #INDENT# self . _shutdown ( True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TLSRemoteAlert ( alert ) #NEWLINE# #UNINDENT# #UNINDENT# except ( socket . error , TLSAbruptCloseError ) : #NEWLINE# #INDENT# self . _shutdown ( True ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . _shutdown ( False ) #NEWLINE# raise